Trim URLs.  Rearrange and comment on code.
Use HttpClient's authorization support.