Improve content type detection