cleaned up the patch for restclient