cleanup and reorg