Consolidating code using the event context.