Updated Template system to include headers and footers