Refactor the templates to reuse the base page