For better or worse, the Philadelphia Energy Solutions refinery has dominated the banks of the Schuylkill for 150 years. The now-bankrupt refinery was the largest (and oldest) on the East Coast, employing about 2,000 workers and bringing hundreds of millions in annual revenue to the city. It was also the single largest source of air pollution in Philly, accounting for about 10% of the city’s fine particle air pollution and about 20% of its greenhouse gas emissions.

Then, just a few weeks before the 4th of July, the explosions happened. Residents across South Philadelphia were woken up at 4 a.m. as their buildings shook, an orange sky overhead. The blast at PES was so strong, it sent a hunk of infrastructure, weighing 38,000 pounds (as much as a firetruck), up and across the river half a mile away. Over 5,000 pounds of (highly toxic) hydrofluoric acid was released into the air. Days after the accident, PES publicly declared it would not reopen the refinery. The fate of the site will be decided in bankruptcy court in early 2020.

The costs of the blast and plant closure are massive — 2,000 workers out of a job and toxicity released into the atmosphere. But the long-term implications can be positive. Philadelphia should grab this opportunity to dramatically reshape its energy ecosystem and transform the PES facility into a green energy hub, supporting the natural ecosystem services that a river wetland can provide while avoiding dangerous air pollution and costly greenhouse gas emissions.

The size, location, and equipment at the site make it relatively well suited to be transformed into a biofuels facility, which could produce lower emissions diesel, marine diesel, and jet fuel; solar generation should also be spread throughout the 1,300 acres to feed the energy grid. City officials can formally incentivize this transition by providing tax benefits and guiding policies for renewable energy producers, such as a power purchase agreement that gives energy producers assurance that the city will purchase the new clean energy, or by removing the site’s fossil fuel tax benefits, which would disincentivize the rebuilding of the refinery.

And the refinery site could benefit from neighbors’ help. The nearby University of Pennsylvania, with an endowment of nearly $15 billion and a stated interest in bridging academia, governance, and commercial ventures, should help shepherd this green energy transition. The university’s Pennovation Works Center, a program focused on incubating entrepreneurial activity, lies just up the river from the PES facility. On Dec. 10, Penn president Amy Gutmann announced the launch of a new Environmental Innovations Initiative, stating “we take very seriously our responsibility to help shape that future.”

This is an opportunity for the university to put its money where its mouth is and help transform PES into a real-world decarbonization laboratory. Penn can and should flex its academic and financial muscles to explore engineering and planning solutions for efficient clean energy systems and grid infrastructure, and present policy and government solutions that facilitate a just transition for fossil fuel workers.

The transition of PES into a renewable energy hub will come with a slew of benefits, including cleaner air and water for the city and downstream communities. On a broader scale, by removing one of the East Coast’s major polluters and taking a stand against reliance on fossil fuels, the closing of the facility will help mitigate global climate change. Over the coming decades, Philadelphia is slated to spend hundreds of millions to make its buildings, transportation fleet, and energy grid more efficient and sustainable. An investment now in a renewable energy hub would go a long way toward achieving Philly’s ambitious sustainability goals as set by the city government.

By wedding the closing of the facility with high-quality job training for workers and community members, Philadelphia can connect the labor and environmental coalitions, showing how renewable energy and job security can go hand in hand in the 21st-century economy.

The site’s sale will be decided in January, at the U.S. Bankruptcy Court in Wilmington. Over a dozen buyers have submitted proposals to purchase the refinery site. These include PES’ founder and former CEO Phil Rinaldi (“Fossil Phil”), who proposed rebuilding the refinery with a few small adjustments to slightly increase its safety and sustainability. The city and its residents should do all they can to make sure that the next use of the refinery is sustainable — and equitable.

The PES refinery explosion is an environmental catastrophe, but it presents an opportunity for Philadelphia to break out of dirty-energy reliance and reimagine its energy ecosystem.

Lucas Isakowitz is a native Philadelphian, a graduate of Central High School and the University of Pennsylvania, and a master’s student at the Yale School of Forestry & Environmental Studies.