Minor cleanup of http handling