Shift map code from View to Controller