Refactor HTTP.hs