Using ip.to_s to simplify ip to_s convertion