unit tests refactor