While it’s still not known what caused the gas explosion and building collapse tragedy that killed two people in New York City last week–the mayor has said the building owner might have been “inappropriately” tapping the gas line –what is clear is that one of the nation’s oldest cities has a problem with its aging gas infrastructure, both inside and outside of buildings.

This was true about a year ago when an East Harlem building collapsed after an explosion, killing eight people, and it’s still true today. According to the Center for an Urban Future, of 6,400 miles of gas mains and 800,000 gas service connections in NYC, 53% and 9%, respectively, were built before 1960–a time when cast iron, unprotected steel, and other materials that can easily corrode or crack were used (new pipes are made from plastic).

Flickr user jasonwoodhead23

“ConEd is, in a lot of ways, a model utility company on this, but it’s inherited a very old infrastructure” says Adam Forman, a research associate at the New York City-based research organization, which has documented the NYC utility’s progress in the last decade at both replacing old lines and reducing leaks. For example, the group found that between Con Edison and National Grid (NYC’s two service providers), there were about 14,000 leaks in 2003, a number that dropped by 30% by 2012. Still, according to a Mother Jones article last year, ConEd was still the third “leakiest” utility in the nation from 2009 to 2013.

The larger point is that while New York City is improving, it’s not moving fast enough. And New York, of course, is not unique in having this problem. Many of America’s urban centers today are living on the edge. Nationally, about 9% of gas pipelines are still made of older, leak-prone materials, according to a recent report from the BlueGreen Alliance. In the last few years, high-profile explosions, such as the disaster that killed eight people in San Bruno, California, in 2010, have brought even more attention to the issue.

But what can the city do to make gas networks safer? More utility accountability to regulations and more rigorous building and service inspections are clearly important, as may be shown as the East Village collapse investigation unfolds. But hugely expensive infrastructure upgrades–always a slow and painful process for cities and states–are what’s ultimately needed. (The federal government generally doesn’t have jurisdiction, though the U.S. Pipeline and Hazardous Materials Safety Administration has pushed pipeline owners to make removing leak-prone steel and cast-iron lines a major priority.)

In New York, Forman says there’s more attention being paid to infrastructure overall, after decades of neglect. Progress has been made, for example, by the “Underground Infrastructure Working Group” convened by the city last year. This group has helped cities better coordinate with the utilities in making repairs and upgrades, since the city’s Department of Transportation and others have a lot to say when ConEd goes about ripping up the streets, as does the city’s Department of Design and Construction. In light of the East Village disaster, Forman recommends another working group of utilities, building owners, private contractors, and the city be convened this year to focus on improving services, including gas, water, and Internet, to buildings–so that “delivery does not end at the meter.”

Some technologies could also help improve maintenance and repair in the meantime. For example, robots that can inspect or even recoat the interior of pipes are starting to come into use, which might be a bit easier to do than, say, ripping up the road. “We’re still seeing a couple of thousand miles of gas mains and services that are vulnerable and old, but you can’t do it all in one year,” Forman says.