move variable to the block it is used in