Procter & Gamble pg , the maker of Tide detergent and Pampers diapers, reported a better-than-expected quarterly profit, helped by cost-cutting and strong demand for its baby, feminine and home care products.

The company has been selling off unprofitable brands and focusing on core brands such as Tide, Pampers and Gillette to revive sluggish sales. P&G sold 41 of its brands, including Clairol and Wella, to Coty coty in a $12.5 billion deal earlier this month.

P&G is also reducing costs through a multi-year plan to save up to $10 billion.

Cincinnati, Ohio-based P&G said net income attributable to the company rose to $2.71 billion, or 96 cents per share, in the first quarter ended Sept. 30, from $2.60 billion, or 91 cents per share, a year earlier.

Excluding items, P&G earned $1.03 per share from continuing operations, slightly beating the average analyst estimate of 98 cents, according to Thomson Reuters I/B/E/S.

 

Net sales remained largely flat at $16.52 billion, but beat analysts’ average estimate of $16.49 billion.

P&G’s quarterly sales have been mostly falling for more than three years, as the company has been cutting its brand portfolio.