split inbox into header and footer files, add base template