Refactor testcase methods