Refactored map and entities.