More progress on refactoring.