Could you use an more anonymous type parameter than Elem ? I thought it was an other class of us, not the generic param. T is good. 
Moreover, on the case of directive, we don't have an uniq Elem, but a triplet to check.