Refactor RestClient request