Move variable declaration closer to where it's needed
Merge pull request #246 from Dmitry-Me/moveVariableDeclaration

Move variable declaration closer to where it's needed