Refactored client class