Refactor to use php so as to avoid rewriting headers and footers on each page.