Refactor http