Suncor Energy Inc., Canada’s second-largest energy producer, on May 1 posted a first-quarter profit that beat analyst expectations, as improved crude oil pricing and higher refining margins outweighed lower production.

The Calgary-based company also said it would focus spending in 2018 on ramping up its two major growth projects; the Fort Hills oil sands project in Alberta and the ExxonMobil Corp. (NYSE: XOM) -led Hebron project off the province of Newfoundland and Labrador.

Suncor said the ramp up at Fort Hills, its largest project, was ahead of schedule, with two extraction units operating, and a third expected to come online in the second half of 2018.

The company’s operating profit, which excludes one-time items, jumped 21.3% to $766.4 million, or 60 Canadian cents per share, in the first-quarter. Analysts had predicted earnings of 52 Canadian cents per share, according to Reuters data.

That boost was driven by better pricing and margins, though partially offset by higher operating costs on planned and unplanned maintenance, the company said.

Suncor’s total upstream production fell 4.9% to 689,400 barrels of oil equivalent per day (boe/d), compared with 725,100 boe/d in the prior year quarter.

Oil sands production was 404,800 barrels per day (bbl/d) in the first-quarter of 2018, compared with 448,500 bbl/d, with cash operating costs per barrel jumping 19% to $26.85, from $22.55 in the year-ago quarter.

Net earnings fell to 48 Canadian cents per share, in the three months ended March 31, as a foreign exchange loss weighed. That compared with 81 Canadian cents per share a year earlier, when profit was boosted by an asset sale and a foreign exchange gain.