Refactored http clinet