Simple refactor of instamap.js