Legacy Reserves LP’s pitch to investors used go something like this: “We buy ugly houses.”

The pitch likely didn’t stoke oil and gas investors, but Legacy wanted to convey its strategy of buying “old wells that the high-flying guys had kind of given up on,” said Dan Westcott, president of Legacy Reserves.

Again, good, tingly feeling not included.

Legacy successfully bought a lot of ugly. The upstream MLP spent more than $2.2 billion on assets in Colorado, Kansas, Montana, New Mexico, North Dakota, Texas and Wyoming, Important for later: Legacy’s wells came with flat, stable production.

At its most superficial, the requiem for many upstream MLPs could be written as “delete the MLP, change name and reboot.” Many MLPs have entered bankruptcy, sold assets and sometimes exited with new identities. Memorial Production Partners is now Amplify Energy and Atlas Resource Partners became Titan Energy LLC, while Linn Energy Inc. reorganized into a series of future crossword puzzle clues: Riviera Resources Inc., Blue Mountain Midstream LLC and Roan Resources LLC.

Legacy, too, has gone the C-corp route—but on its own terms. In September, the company completed its internal reorganization and rang the bell to open the NASDAQ exchange. (Good television; only on CNBC.)

It’s no secret that on the path to the downturn, upstream MLPs leveraged and overspent on a scale that could make Nicholas Cage’s crazy spending sprees—a 7-million-year-old dinosaur skull, shrunken pygmy heads and a $150,000 octopus—seem like prudent investments.

In the shale boom years, companies such as Atlas, Linn, Vanguard Natural Resources Inc., Breitburn Energy and EV Energy Partners LP (now Harvest Oil & Gas) ran up a tab of at least $29 billion.

From 2015 to 2017, those same companies—Breitburn, Linn, Vanguard, Altas and others—filed for bankruptcy, bringing more than $23 billion to the courthouse. In comparison, the Great Depression kicked off on Oct. 29, 1929, with stock markets losses totaling $14 billion, unadjusted for inflation.

Alerian, keeper of all things MLP, noted that in 2014, seven upstream MLPs graced its index but there were none as of November 2017.

Legacy suffered, too. But its passion for heavy PDP rock sustained it.

The company avoided bankruptcy precisely because it was buying those supposedly ramshackle assets with stable production. With limited growth through the drillbit, its mature oil and gas production declined at rates of less than 10%.

While new wells bring a torrent of new production and growth, much of can fade quickly. That creates a strain for MLPs to churn out cash and satisfy unitholder expectations—particularly if they expect distributions to remain consistently high.

“Investors got in their minds that if they pay me this this quarter it’ll never go down. ‘They paid me this distribution, so I’ll get this distribution in perpetuity,’” Westcott said.

Predictable, steady cash flow was suddenly in. PDP reserves made up about 92% of Legacy’s total reserves and lacked the demands of a capital-intensive drilling program.

“We were very much buying older production with established cash flow,” Westcott said.

That stood in contrast to companies “kind of blowing and going and running a bunch of rigs and focused on their new development.” Their focus seemed to drift to wells that “were bigger and sexier.”

Legacy’s non-sexy acquisitions, with a few changes and tweaks, could be made efficient and profitable.

The market, however, drew no distinctions for Legacy. Of the 13 MLPs Legacy once ran with, 11 went under.

“Part of this transition is to just distinguish ourselves from the downfall of that space,” Westcott said.

Fortuitously, Legacy finds the bulk of its reserves in the Permian Basin, where horizontal drilling has since turned the basin upside down. “It turned out we owned a lot of very good spots,” he said. The company has spent time and money building up its drilling and geology divisions.

Legacy has no major divestiture plans, and its acquisition interests are limited to swapping assets for some of its fragmented Permian acreage.

And it still has an asset base to generate cash flow, which left it standing as others stumbled. Westcott recalls a Warren Buffet quote to sum up the past three years: “You only find out who is swimming naked when the tide goes out.”