Refactored map and ui systems