moved a part to a function