Further progress on refactor.