move a declaration to the beginning of a block