Clean-ed up dead code, and use helper for local_ip.