since you are doing .toSet, any benefit in doing filter first?