refactoring map.js