refactor Client tests