Clean up IP address function

Signed-off-by: Zeklandia <awood5659@gmail.com>