improved prepare test case