header and footer refactored