I wonder if this can be a generic function that can be used by deferred adding a callback? Can't think of anyone else using it for now. What do you think?