Refactor mapinit fragment (fixes #17)

(fixes #17)