refactoring unit test.