refactored data structure of events