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'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.

Read More