Refactored the Map definition