Refactor Event registration