Clean and add code to detect if target exists on network.