refactoring to allow for new providers and event types