Factor HTTP specific stuff into its own file