More cleanup
Extract footer template
Extract helper methods into files