Added routing for different kinds of events.