moving more logic to the map module