using callbacks instead of events in many places