Remove variables and function that do not need to be in the scope, rename footer_template