Refactored query param parsing in RestClient.