Better code for test if footer

This code does the exact same test with much fewer steps.