Non-trivial code reorg.