Http refactoring