unit test refactoring