refactoring on unit test cases