Fixes variable declaration (whitelists -> whitelist)
Refactors ::getIpAddress() to remove complexity