Refactoring unit test methods