refactoring topology_service and map creation