Refactored to use sitemap as a map instead of a collection and appmodel has additional useful features