move variable declaration at beginning of block