Unify IP address retrieval

Fixes #20