refactoring get http response