refactoring tests