major re-write to use the http package