First-quarter earnings reports for E&Ps reveal the sector has returned to profitability after six consecutive quarters of losses. This is according to Bernstein Research, which summed up the financials of 60 North American E&Ps to come up with a picture of the upstream business overall.

As would be expected, higher oil prices were at the heart of the rebound to profitability. The analysts said that crude prices increased by 5% over the previous quarter, to $51.70, and the blended price rose to $37.37/boe, a 4% bump up from $35.79 in fourth-quarter 2016.

Also supporting the group’s stronger performance was a continued focus on cost reduction. The expense cutting was hefty—30% in exploration expense quarter-to-quarter and 10% in SG&A. As oilfield service companies begin the march to recapture upside lost during the downturn, production costs rose 3% over the same period.

Upstream costs are about $30/boe, which is relatively unchanged from the beginning of 2016, according to the report. Costs had topped $40 at the height of the boom. The analysts expressed concern about a “sharp drop in exploration expenses—to levels not seen in nine years,” in the first two quarters in recent years. “We worry that cutting exploration expense is a form of harvesting future options into today,” they said.

Production growth held flat for the quarter. “Given the trajectory of rig count, we expect this to inflect to positive territory next quarter,” said the analysts, led by Bob Brackett.

Capital providers will be heartened to see that when taking into account only organic capex, the sector underspent cash flow for the third consecutive quarter. Operating cash flow rose by 13% for the quarter, while organic capex rose only 7.5%. “As a result, E&Ps only spent 88% of cash flow on organic capex in first-quarter 2017,” the analysts noted.

Financiers also will appreciate the sector’s ongoing caution regarding the massive leverage that took down so many E&Ps when the downturn arrived. From the record highs of first-quarter 2016, the sector’s debt to total capital is now at 39.7%--the high was 42%.

A look at EBITDA found that since the price decline, the overall margin has gradually fallen to about 35%, and in the first quarter of last year was the lowest since 2004. As the industry has rebounded, however, EBITDA has continued to improve, hitting a 53% mark in the first quarter of this year. “Large caps generated about $17.50/boe for a 53% EBITDA margin,” the report said. Small caps also improved, at $14.63/boe.

The trend toward spending restraint is illustrated by the cash flow from operations numbers of the companies studied. E&P outspending began in 2012 and picked up speed, reaching a high of 330% in the first quarter of 2016. Since the third quarter of last year, however, “we are seeing the sector underspending the operating cash flows and staying within the 85% to 95% range,” the analysts said. In particular, large caps are toeing the line. Small caps are continuing to outspend their operating cash flows. E&Ps keep chipping away at debt, achieving debt levels of below 40% in relation to total capital in first-quarter 2017. They funded acquisitions and debt payments with asset sales, equity issuance and cash.