Moves HostName and IPRange parsing to util method.