tests refactored