refactored map code