finished restructuring functions