refacotring the map