Moved variable declaration to prevent hoisting