optimize test cases