refactor http interface