Sad times in Waterloo, Ontario today, as BlackBerry, the company behind BlackBerry Messenger has decided it is backing away from the consumer market entirely due to massive losses totaling nearly $1 billion USD this quarter, attributed mainly to very poor sales of the company’s Z10 flagship smartphone, which was released in January as the first ever BlackBerry 10 device.

BlackBerry says it will take a “primarily non-cash, pre-tax charge against inventory and supply commitments in the second quarter of approximately $930 million to $960 million” due mainly to “overstocking” the Z10 and leading to huge inventory charges. In the second quarter, the company shipped just 3.7 million smartphones, most of which were running the company’s legacy BlackBerry 7 operating system. BlackBerry did not disclose how many BB10 devices were sold in the quarter, but sold a total of 5.9 million devices to end users.

Along with stepping back from the consumer market in favor of the “prosumer” and enterprise-focused market, the company also says it will cut its smartphone offerings down from six to just four devices, which will include two high-end (BlackBerry Z30 as an example) and two entry-level devices, one of which will be a lower-priced Z10. The company also announced that unfortunately, it’s planning to lay off 4,500 employees, around 40 percent of its workforce.

“We are implementing the difficult, but necessary operational changes announced today to address our position in a maturing and more competitive industry, and to drive the company toward profitability,” Thorsten Heins, President and Chief Executive Officer of BlackBerry said. “Going forward, we plan to refocus our offering on our end-to-end solution of hardware, software and services for enterprises and the productive, professional end user. This puts us squarely on target with the customers that helped build BlackBerry into the leading brand today for enterprise security, manageability and reliability.”

The enterprise market is where BlackBerry continues to shine; installations of the company’s latest BlackBerry Enterprise Service servers increased from 19,000 to 25,000 in three months. The company’s board says it’s examining “strategic alternatives” which could include outright sale of the company even as its BBM service is spun off on its own. Regardless of the changes ahead, here’s hoping those who do end up losing their jobs can find work in short order.