Refactor events.