Refactor template structure and add page template