make tests pass, but some refactoring is needed