Reduce code complexity in And and Or termination criteria.