HTTP refactor