Remove multiple var declarations by moving them to top