Refactor Client, clean up test case