Change headers and footers to use functions with options