Cleaned up maps javascript