refactoring, two unit tests are failing