Move method to get address of network interface to utils.