New York CNN Business  — 

BlackBerry is no longer a smartphone company. That’s great news for BlackBerry investors.

BlackBerry (BB) shares surged more than 10% Friday morning after the company reported earnings and sales that topped forecasts. The company also raised its outlook for its current fiscal year. BlackBerry (BB)’s stock has now surged more than 40% so far in 2019.

The key to BlackBerry’s success: a transition from the cutthroat business of selling hardware to the far more lucrative world of software – particularly cybersecurity and the so-called Internet of Things for connected devices like cars.

“Everyone remembers BlackBerry as a cell phone company,” said BlackBerry CEO John Chen in an interview with CNN Business Friday morning. “But a big part of our business now is security.”

Since Chen took over BlackBerry in late 2013, he has revamped the company to focus more on software. The company stopped making its own branded phones in 2016 and now relies on partners to do so.

The company now generates a majority of its sales from software and services to big businesses as well as licensing.

BlackBerry also recently acquired Cylance, a leader in using artificial intelligence and machine learning for cybersecurity. Cylance sells a lot of its products to banks.

Chen told CNN Business that BlackBerry may do some other small acquisitions to complement the Cylance business as well as its QNX software that powers infotainment systems in cars.

But the message to Wall Street is clear. BlackBerry, whose corporate survival was in doubt shortly before Chen took charge as the company was losing money and hemorrhaging cash, is no longer on death’s door. It’s thriving.

“We’re done rebuilding. We’re looking to invest.” Chen said.