refactor httprequest