Microsoft is giving Windows a demotion, and leaning into the cloud.

CEO Satya Nadella told employees on Thursday that Terry Myerson, leader of the Windows and Devices Group, is leaving the company.

"Microsoft has been my work, my team, and my purpose for 21 years," Myerson wrote in a LinkedIn blog post. "It is an emotional day."

His departure had been planned for "some time," Myerson added.

The shakeup includes the formation of two new engineering teams that will prioritize Microsoft's cloud and artificial intelligence products — a move that should make investors happy, said Brad Reback, a software analyst at Stifel.

Related: Next stop for Microsoft: $1 trillion?

Morgan Stanley (MS) said recently that Microsoft (MSFT) could hit $1 trillion in market value within a year, thanks in large part to the strengths of Azure, Microsoft's cloud computing service, and the cloud-based Office 365 software suite.

Thursday's announcement "further demonstrates that those are the growth engines going forward," Reback said. And it aligns with Microsoft's long-term priorities.

"Microsoft has actually been moving away from Windows and more towards the cloud, analytics and AI for the past ten years," explained Laura DiDio, an analyst at ITIC. "This did not happen overnight."

So far, the company's investment in the cloud, artificial intelligence and the Internet of Things has paid off. Amy Hood, Microsoft's chief financial officer, said in January that the company's commercial cloud revenue grew 56% year-over-year. In that quarter, Windows commercial products and cloud services sales fell 4%.

Related: Microsoft's epic court battle with DOJ is coming to an end

It's not unusual for Microsoft to blow up its organizational structure. In 2015, Nadella ousted three key executives, including the former Nokia CEO. That was just a year after Nadella replaced Steve Ballmer as CEO.

DiDio pointed out that Nadella has made major changes quickly during his tenure. "That's the way you have to move," to stay relevant, she said. "You've got to be agile to stay ahead of the game."

The changes don't mean that Microsoft is totally giving up on Windows, DiDio said. But they do mean that Nadella is focusing the company's energies around stronger assets.

"They're de-emphasizing Windows," she said, in order to become a stronger "player in cloud and artificial intelligence, because that's where the money is."