Change the whitelist from vector to set for speedup.