refactor get_local_ip