refactor take out headers and footers