Move variable definitions as close as possible to where they are used or set.