improved formatting & comments, fixed semantics (uri -> host)