map: refactoring