Continue refactor, delete old code, update unit tests.