tests refactored to repeat less