extract header footer and create partial