Refactor HTTP