First cut of the unregister function