Refactored the getMap handler a little