refactoring unit tests