moving http functionality to a different class