Refactoring map loading.