Refactor hotplug implementation