Refactoring RestClient call