make net_to_net more generic