Refactor sitemap plugin.