use QSet for fast lookup