refactoring
refactoring map.js