Drop obsolete comments
Split type detection to a helper function