reduce number of calls to unify/fail?, since it's an expensive function.