Some optimizations to the http codec