Small cleanup to http handling