refactored for httprequests.