Refactored XHR to HTTP