refactor templates and page builds