Simplify math detection