refactored templates to use a common header and footer