cleanup and reorganize