refactoring - use sets, not lists