Refactor/improve
Switching of header/footer