Refactor MapView functions.