Move variable declarations closer to where they are used.