refactored a bit into modal map controller