Refactor, move header, footer to template.