optimization for the map