Refactor move templates and pages