More code reorg