refactored code to show and hide footer region