move map loading logic in an event subscriber