refactor http connect utils