Extract events into its own class