extract header and footer from layouts