making models into event emitters