Exported map rendering code to Map.java