Further refactoring toward an event-based model
More refactoring to event-based model