rebuild the structure