Dynamic event handling registration/unregistration