refactor http for scaling