refactor determining url of sitemap and add tests