Simplify class comparison in tai_difference