refactored map to M