I was thinking just of the dictionary lookup for req.headers['Accept'], since that's happening twice. Special-casing HTML and plain text is probably fine. Maybe the static list used on line 430-432 should be an attribute that doesn't have to be instantiated for each request? Would it make sense to special-case any other well-known content types?