tests refactored and green