Improves scoping and footer