refactor httpreuqest