Refactored registration-unregistration