Make whitelist check code more readable