Refactoring the events data source into its own class.