Reorg to add unit tests.