Removed code duplication in ClientInvocationService.