unit tests refactored