Improved whitelist code.