Cleaner way to join IP addresses into array