refactored map