Buoyed by a raft of discoveries and improved efficiencies across operations, BP plc delivered better-than-expected results for the second quarter, despite continued outlay for the 2010 Macondo well blowout.

The London-based supermajor recorded a 10% gain in production and pulled to a cash breakeven oil price below $50/bbl during 2Q2017 as the company worked to contain costs.

Quarterly net income was 37% above Wall Street consensus, and BP generated almost $5 billion from operations, nearly at the levels of 2012 and 2013, when oil prices were much higher.

Reining in spending remains the focus, as BP resets to a “new normal” of $50/bbl oil, CEO Bob Dudley said during a Tuesday conference call. The aim is to reduce operating breakeven costs to $35-40 by next year, further cushioning the company from future commodity price shocks. Cash breakeven was $47/bbl for the first half of the year.

“It is a tough environment, and it could remain that way for some time” Dudley said. However, $50/bbl is “a pretty good fairway for us going forward.”

The business has been restructured to be “resilient to these changing conditions,” as its strategic plan laid out in February. “That means we are getting back to growth and securing our future over the longer term…

“Across the Group we expect strong growth over the next five years. In the upstream, we are on track to add more than 1 million boe/d by 2021 from 2016. Around 800,000 b/d net to BP is expected to come from our major projects by the end of the decade with an additional 200,000 b/d coming from our recent portfolio additions.”

New projects “should deliver on average 35% better operating cash margins compared to the base portfolio in 2015 and around 20%, on average, lower development costs. This makes us increasingly resilient to the environment as we look to move the portfolio even lower down the cost curve.”

BP is “readjusting the business for a new price environment,” Dudley said. The company needs to continue to demonstrate its progress, but “I think we’ve delivered pretty well on this quarter. We really drive our business for cash, and that’s the most important number that comes through on this quarter.”

Royal Dutch Shell plc CEO Ben van Beurden during the 2Q2017 call last month outlined a “lower-forever mindset” for oil prices. BP’s mantra remains lower for longer. How long, though, remains a question.

Dudley in 2015 coined the term, “lower for longer.” CFO Brian Gilvary updated it during the conference call, indicating BP sees prices remaining “lower for longer but not forever.”

Prices “will firm this quarter,” he said of 3Q2017. “They will stay underpinned by strong demand,” but begin to drop off in the fourth quarter.

“We can now see where the price elasticity is,” Gilvary said. “As the price comes up to $52-53/bbl we start to see some uptick in activity. As it drops to $45, we start to see that curtailing. For 2018, something around $45-55/bbl is probably a good range.”

The quarterly performance was stalled a bit by the Macondo oil well blowout in the deepwater Gulf of Mexico seven years ago, which to date has cost BP more than $60 billion. On the payments, net debt rose to a record $39.8 billion at the end of June, up almost $9 billion year/year from continuing Macondo-related payments.

Debt is “in line” with Macondo payments, Gilvary said. It should retreat during the second half of the year with an expected $4.5-5.5 billion in asset sales. Macondo payments have reached a “high point for the year,” and now should decline to about $1 billion a year.

The Macondo has been a drag during the industry downturn, but BP today is covering expenses with cash generated from operations rather than debt. The company generated $4.9 billion in operating cash flow during 2Q2017, excluding Macondo, compared with $3.9 billion in 2Q2016.

New project startups and acquisitions should begin to boost production by as much as one-third over the next three years, Gilvary said.

Production climbed by double-digits from a year ago in part on discoveries, including the natural gas-rich discovery offshore Trinidad and Tobago, as well as projects in Egypt, Senegal, the UK’s North Sea and India.

“Looking over the course of the year, demand for oil is expected to remain robust, and increase by an above-average 1.5 million b/d this year,” Dudley said. BP is forecasting continued recovery in gross domestic product growth, supported by sustained lower oil prices.

At the same time, supply outside the Organization of the Petroleum Exporting Countries (OPEC), “is expected to increase by 700,000 b/d this year driven largely by the recovery in U.S. tight oil production,” Dudley said. However, depending on moves by OPEC and domestic growth, “there remains a lot of uncertainties around the timing of that and around the longer term outlook.”

BP’s underlying replacement cost profit in 2Q2017 was $680 million, around 5% lower year/year and 55% lower sequentially, but results beat average analyst estimates of $518 million. Compared with a year ago, the latest result reflected a $753 million write off from Angola operations, which BP had flagged in June. Underlying operating cash flow, excluding Macondo payments, was $6.9 billion.

Upstream profits totaled $710 million, versus $29 million a year ago. The downstream division earned $1.41 billion, versus $1.51 billion in 2Q2016.

Organic capital spending through the first six months was $7.9 billion, and BP is tracking total 2017 spend at the lower end of $15-17 billion.

BP, whose shift from oil to natural gas continues, also is strengthening its renewables business. Dudley disclosed Tuesday that the company is in talks with electric vehicle (EV) makers to partner on battery recharging docks across its global fuel service station network to benefit from the move away from diesel and gasoline vehicles.

BP also is studying autonomous vehicles and the potential for combining natural gas with solar power generation, Dudley said.

Shell, which also has shifted to gas from oil, disclosed last week that it too is diverting more capital to renewables, including into EVs.

The announcement by Europe’s largest oil and gas producers comes as the UK last month followed France’s decision to halt the sale of internal combustion vehicles by 2040. Ending the use of traditional vehicles is “absolutely necessary,” said van Beurden last week. The company is taking into account a “very aggressive scenario” in which oil use is peaking.