Refactoring unit test