Healthcare conglomerate Johnson & Johnson has its growing drug sales to thank for its surprisingly strong earnings last year. That’s especially good news as its medical devices unit–a historically strong area for the company–faced declining sales and upheaval internally as the company restructures the unit.

Overall, drug sales were the biggest driver of growth for the company. Drug sales were up 4.2% worldwide last year, excluding the impact of foreign exchange, helped by products like psoriasis treatment Stelara and anti-inflammatory drug Simponi. Stelara sales were particularly strong, gaining 26.2% last year compared to 2014, excluding foreign exchange.

Johnson & Johnson, which claims title to the world’s largest health care company, has been relying on drug sales to spur growth as its medical devices unit struggles with declining revenue. Drug sales account for about 45% of total revenue and have grown nearly 9.6% annually since 2010, according to an analysis by Sam Fazeli, a senior industry analyst at Bloomberg Intelligence. Medical devices, which have historically topped sales of pharmaceuticals over the past several years, now account for about 36% of sales.

The company plans to cut about 3,000 jobs within medical devices as it restructures the unit, focusing on the orthopedics, surgery, and cardiovascular businesses which have been hit particularly hard by cost-cutting from insurers and hospitals. The move is expected to save Johnson & Johnson as much as $1 billion by the end of 2018. The company’s consumer medical devices, vision care, and diabetes care, part of the same division, won’t be affected by the cuts.

 

The health care giant isn’t giving up on medical devices. Instead, it plans to use the move to “accelerate the pace of innovation, address unmet patient needs, and drive growth,” according to the company. This could include buying companies with interesting products, either in devices, consumer products, or pharmaceuticals. CEO Alex Gorsky said that the company is actively looking for the right deal and sees “opportunities across all three of our different sectors.”

The diversified growth will be especially important as Johnson & Johnson’s JNJ drug sales begin to slow amid growing competition, and new competitors like GlaxoSmithKline GSK and Bayer are likely to only increase the pressure in 2016, according to Fazeli.

Johnson & Johnson reported its fourth-quarter and full-year 2015 earnings Tuesday. Earnings were $1.44 a share for the quarter, excluding select items, surpassing the average analyst estimate of $1.42 a share. Revenues for the quarter were $17.8 billion, falling just short of analyst expectations.