Move some variable declarations closer to where they're used.