Fix bug not displaying map.
Refactoring.