manually lift variable declarations to top of scope