Refactor http keepAlive