header and footer optimization