refactored http request