Cleanup + reorg to generate multiple files