Improve content-type handling