beginnings of a refactor with all passing tests...