Refactor mapinit fragment