Refactor the map ui rendering class