Code refactoring.
Add whitelist test script.