Event-driven framework