Foursquare is getting a new CEO, along with a pile of cash.

The company has raised $45 million in an equity round led by one of its angel investors, Union Square Ventures, and its co-founder Dennis Crowley is giving up his CEO title. Other early Foursquare investors Andreessen Horowitz, Spark Capital and DFJ Growth also invested in the new round, along with Morgan Stanley. Foursquare says the round was "over-subscribed" and took a few months to put together.

Crowley has served as Foursquare's CEO since he co-founded the mobile location data company in 2007. He'd previously founded a similar company, Dodgeball, and sold it to Google in 2005.

Now he's passing the top job to Jeff Glueck, who joined Crowley's company as COO in June 2014. With Glueck as CEO, Crowley will become executive chairman and Steven Rosenblatt, Foursquare's Chief Revenue Officer, will become Foursquare's president. Foursquare says the executive shuffle will give Crowley time to lead the company's vision without day-to-day distractions. Crowley says he'll continue to stay very involved and working with the company in a full-time capacity -; "1000%" he says -; and that the transition has been on his mind for the past year.

"It feels amazing," Crowley says. "We're taking the two strongest business leaders we have and putting them in the spots they're supposed to be in."

The reorganization and cash infusion comes after a critical year for the company, during which it transitioned from a consumer product to an enterprise service generating real revenue.

Originally, Crowley thought of it as a game

When Foursquare was founded, it came up with the concept of local "check-ins" and was positioned as a game in which friends could keep track of each others' whereabouts. But after scaling to about 30 million users, interest in the app dwindled and the company struggled to gain much initial advertising revenue. Would-be users were confused by the app and what it was supposed to be. A game? A Yelp competitor? A Check-in tool?

Crowley told Business Insider in September that he used to refer to his product as a "Swiss army knife" with lots of nifty features. But he eventually realized the lack of product focus was actually hurting his startup. So he started to make some tough decisions and big changes.

In 2012, Rosenblatt joined the company to begin building an ad sales team and moving revenue in a meaningful way. One year later, the company raised $35 million in a round that valued the company at roughly $650 million.

During the summer of 2014, Foursquare unbundled its flagship app into two products: Swarm and Foursquare. Swarm would house the game side of the app and encourage users to check in to local venues to earn badges. The new Foursquare app would operate like Yelp, giving smart local recommendations to users with tips on what to do in each place.

Foursquare began to diversify its revenue as well. Instead of just selling traditional banner units to advertisers, Glueck and Rosenblatt have helped come up with a way for Foursquare to sell its robust location data to other businesses and brands. 

How to make money in mobile apps

Rosenblatt believes there are three ways mobile apps can make money. They can either have a massive audience to sell against (like Snapchat and Facebook), really good technology that allows for great content distribution (like publishers), or they can have data other companies need and want to pay for.

And for Foursquare, data seemed to make the most sense. Now, Foursquare generates revenue through native advertising, a programmatic "Pinpoint" advertising platform, and its location data, which it bundles up and offers to subscribers. He says the enterprise and pinpoint businesses are the biggest growing chunk of the company's revenue (170% and 160% respectively last year) and as of September, the company's data-driven advertising solutions and API were generating revenue at a $50 million annual run rate. Its data is licensed to companies like Yahoo, Microsoft, Twitter and Pinterest. About 100,000 developers use Foursquare's API.

Crowley and his company won't comment on Foursquare's current valuation in the new raise, but it's reportedly less than half of that previous $650 million figure. The company says it feels good about the terms, which were "structured in an employee-friendly way." Regardless of the valuation and even with Crowley--who is expecting his first child soon--taking off his CEO hat, investors seem to be bullish on the new, improved Foursquare.

Fred Wilson, a Union Square Ventures partner who was an angel investor in Foursquare, wrote a blog post on Thursday about startup founders and tenacity, in which he praises what Crowley has built.

"Maybe no USV portfolio company (with the exception of Twitter) has taken it on the chin more for being the 'hot company that fell out of favor,'" Wilson wrote. "And yet sitting here today, Foursquare has built a very real business that is growing nicely and has a very bright future...You can say what you will about Foursquare, and don’t bother because it most certainly has already been said and not very nicely, but it has survived and is thriving."

This story first appeared on Business Insider