Refactor test case reader