Rebuilding energy systems in urban areas