map refactoring