Client test refactoring