Refactor eventprovider