Refactor http transport