Added detection of events and callbacks