Move variable definition to top of scope