Moving variable declaration to the beginning of the block