shifted some common functionality to testcase class