unit tests refactoring