Refactored IPAM discovery