refactoring unit test