cleanup and organized map.js