replaced snippet with events