Huge cleanup and reorg