Move variable declarations into main block