Refactored event system to use AbstractEvent.