Make factors return sets instead of lists