http.js refactoring.