Now that Stephen Elop is out as head of Microsoft’s flailing phone unit, where does the Windows phone go from here? Redmond badly trails Apple and Android, and analysts say that to finally succeed in mobile, the company needs to attack from both the high end and the low end. The odds of that happening? Pretty dismal, but that doesn’t mean it’s throwing in the towel on mobile just yet.

At the Mobile World Congress in 2015, mobile chief Stephen Elop showed off a video of Microsoft's devices in action. A man is walking through a city, switching between a Windows Phone and a Surface tablet. He takes photos on his phone, switches to his Surface and scribbles something. Grinning, he eventually reveals to the camera the beautiful collage he’s been working on, and the video stops.

But as of Tuesday, Elop is gone as part of a massive restructuring of Microsoft's mobile unit. “This is the unwinding of the Microsoft acquisition of Nokia. They spent $7 billion and they certainly haven’t realized a return on that investment,” said Avi Greengart, research director of consumer platforms and devices at Current Analysis.  “It was a terrible mistake, but it was one that was understandable at the time.”

To say the least, Microsoft’s devices division has struggled. In the third quarter of fiscal year 2015, it posted a negative $4 million phone hardware gross margin. Microsoft spent more money on making the phones than it got back in sales, and that didn’t even translate into market share. Windows mobile market share is at 3.3%, according to Comscore, while Apple and Android sit at 42% and 52% respectively.

Elop’s departure was part of a larger shakeup of the devices division. Nadella has now placed Terry Myerson as head of a newly merged Windows and devices group. With this move, Microsoft is better positioned to shift its resources from hardware to software-as-a-service, one of CEO Satya Nadella's key priorities.

As CEO, Nadella has expanded the business beyond its traditional model to act as more of a provider of services. A mobile-first philosophy, where the objective is to get mobile consumers into the Microsoft ecosystem, is what some believe is behind the reshuffle.

“Think about your friends or parents. They have a device now. It’s probably a smartphone. It’s very difficult to sell them on that next phone because the hardware features are not interesting or relevant enough,” said Gartner analyst Tuong Nguyen. “But what is going to compel that change is software or services.”

Greengart points to a number of ideas, such as apps that can run anywhere and free Windows for devices smaller than 9 inches, which show Microsoft is focused on hooking consumers into its software, whatever it takes. “The strategic goal is to maintain an overall level of profitability for the business,” said Greengart. If that means losing money on unprofitable devices, as long as people are enticed into using Microsoft, then so be it.

So if software and services are key, why bother with hardware? “It’s like having retail stores. It’s more of a branding move,” said Allen Adamson, chairman of Landor Associates in North America. “If consumers can’t feel you, touch you, see you, it’s harder to connect with you as a brand.” Adamson says that a headwind to establishing Microsoft as a major mobile brand is its association with the desktop, and the company will need to innovate to show consumers that it has some new and interesting ideas.

Maintaining a hardware line also helps persuade other companies. Nguyen says that beyond Microsoft’s own offerings, traction has been low with Windows phones. The few partners offering Windows phones have seen small returns, so staying in the hardware game also demonstrates potential. “I think they’re trying to prove that, hey, this is at least a viable and interesting operating system for mobiles that consumers want to use,” he said.

Microsoft is facing stiff competition from the high end with competitors like Apple and Samsung, and from the low end with cheaper offerings in the Asian markets. Whether its hardware division succeeds is less important than the question of how to get Windows everywhere. By making Windows free, demonstrating value to the consumer, and innovating in software, Microsoft has the potential to make Windows a big hit on mobile. And that’s where the company’s future lies.