Last month, we looked on in horror as millions in Texas lost power due to frigid temperatures. Many of us in Pennsylvania are now wondering: How can we make sure this kind of disaster doesn’t happen here?

It’s certainly not out of the question. Our energy is produced at massive power plants hundreds of miles from the people using it, our power infrastructure is decades old, and our state legislature still fails to acknowledge the growing impacts of climate change. We need to take bold steps to move Pennsylvania into the 21st century today to avoid disaster in the future.

» READ MORE: Don’t fall for new GOP lies. In reality, deadly Texas freeze is a plea for a Green New Deal | Will Bunch

Some of Pennsylvania’s leaders are using this disaster in the Lone Star State to argue against the desperately needed shift to renewable energy to tackle the climate crisis. But as more facts about Texas’s energy-system disaster have emerged, they have shown that the crisis happened because lawmakers and regulators have failed to adequately prepare.

Our nation’s energy system is more fragile than it should be, which will only worsen as climate change brings more extreme weather. To protect against similar disasters in the future, we must fix three key vulnerabilities in our energy system.

First, the United States depends on big, centralized power plants to produce most of our energy and transmission lines to carry that power over long distances to our homes. Both Pennsylvania and Texas get most of our power from plants burning fossil fuels like coal and fracked gas. And as recent events have shown, problems with just a few of those facilities or transmission lines can quickly affect millions.

Second, extreme weather events are becoming more frequent and intense. The infrastructure we built 30 or 50 years ago isn’t equipped to handle the hotter summers and heavier storms that we’re already seeing in the commonwealth. Relying on outdated infrastructure simply kicks the can down the road for future generations to deal with.

Third, our dependence on fossil fuels produces climate-change-causing pollution, which will inevitably drive even more extreme weather in our future and increase the risk of grid failure.

To solve these problems we must create a better and more resilient system.

What might that look like in Pennsylvania and the Philadelphia region? For starters, we would produce more power locally. That would mean solar panels on more roofs, energy-storage technology in more homes, electric vehicles in more garages, and local “microgrids” in communities (like the one proposed just across the river in Camden). Having a solar panel on your roof can be a difference-maker in extreme weather because they produce energy very close to home.

We must also waste less energy. Centralized fossil fuel power plants lose roughly 67% of the energy they produce through heat, and waste even more in transmission. Energy-efficiency improvements like better building weatherization and more energy-efficient appliances can reduce stress on the grid at times of high demand. Better-insulated homes, schools, and offices are more comfortable in any weather.

Finally, while we produce more of our energy locally, we should reinforce our ability to share electricity across the country. Texas’ stand-alone grid left it unable to receive the help it needed from other states as its plants went offline. Pennsylvania is well-connected to our neighboring states through the PJM grid. But as the country moves toward renewable energy, our grid may benefit from stronger linkages to other regions to help share energy from places of abundance to places of need.

» READ MORE: Natural gas should be a part of Pennsylvania’s energy future | Opinion

Improving the resilience of our energy system will require moving entirely away from fossil fuels and switching to renewable energy. Studies have shown that it is possible to build a system that runs entirely on clean energy and keeps the lights on. And, unlike gas, coal, and other fossil fuels that are inherently finite, renewable energy sources never run out.

As Texas begins to recover from this historic freeze, state lawmakers in Pennsylvania should pay close attention to that state’s mistakes, instead of doubling down on the same failed approaches. To start, the Pennsylvania legislature should immediately invest in improving the commonwealth’s energy grid and should pass legislation proposed by State Rep. Chris Rabb (D., Philadelphia) to put Pennsylvania on the pathway to a 100% renewable energy future. Lawmakers should also act on bipartisan energy-efficiency legislation from State Reps. Wendi Thomas (R., Bucks) and Jenn O’Mara (D., Delaware) and State Sen. Lindsey Williams (D., Allegheny).

A cleaner, safer, more resilient energy system is possible. With smart planning and wise decisions, we can make this vision a reality from the Lone Star State to the Keystone State.

Kelly Flanigan is a climate solutions advocate at PennEnvironment.