More cleanup. More unit tests.