improve test case handling