Switch to hash set if there's a large number of dependencies