BlackBerry's transformation from struggling smartphone company into a burgeoning leader in cybersecurity software and connected cars is on track.

The company now generates more than 90% of its total revenue from software and services. And 81% of those sales are recurring. In other words, BlackBerry is no longer subject to the fickle tastes of consumers and has hitched its wagon to corporate customers.

BlackBerry (BB) reported profits and sales Friday morning for its latest quarter that topped Wall Street's forecasts. The stock was up more than 15% in late morning trading on the news.

CEO John Chen, speaking to CNN Friday, said the company's biggest successes this quarter were in the connected and autonomous car market, with revenue growth of about 30% for the business unit that includes the QNX software business for cars.

Chen said BlackBerry is working hard to win more customers in the automotive market, pointing to a deal it announced in January with Chinese search engine giant Baidu (BIDU) to jointly develop self-driving cars.

The company, under Chen, realized a few years ago that it was a losing battle making devices that generated razor-thin profit margins at a time when Apple (AAPL) and Samsung (SSNLF) dominate the smartphone race.

That's why BlackBerry decided in 2016 to stop making its own phones and outsource the production of devices with the BlackBerry name on them to other manufacturers.

Since then, BlackBerry has gone all-in on software.

BlackBerry hoping for a new 'Spark'

So what's next? Chen said he's hopeful that BlackBerry's new Spark security platform, which is kind of like instant messaging on steroids, can make a bigger presence in the health care market. Spark integrates video chat, texts and other forms of media.

BlackBerry is targeting health to help the company expand beyond its core markets of transportation, governments and financial services companies.

Investors are pleased with the turnaround too. BlackBerry's stock is up more than 60% since Chen took over nearly five years ago. That's solid, but it has lagged the performance of Apple as well as the Nasdaq.

Still, Chen has cleaned up BlackBerry's balance sheet. The company now has $2.4 billion in cash and just $740 million in long-term debt. Rumors about BlackBerry going out of business are no longer running rampant the way they were before Chen joined.

BlackBerry's board is happy with Chen's leadership as well. BlackBerry announced in March that it was extending Chen's contract through November 2023.

That may also put to rest some of the rumors that Chen was only going to stick around long enough to sell BlackBerry to a larger rival.