Changing CollabStream code to accept Cadal function