template events is a function that takes event type to evt handler map