refactor map controller