Refactored footer code