refactoring testcase