Cleaned up code for header and footer