Modified middleware to use new ContentType object.