refactor urls in templates