Reduced ip_as_string code