improve content-type handling