Move variables to section of code where they are used.