Map events
Add popups and refactor