Made more progress on the refactor.