refactored to use angular to reduce duplication of headers and footers etc