refactor http out of fetch