registry/event.go refactoring, testing