The fact that the callback is always created by us and not by the user makes me think that all this code can stay in the callback or at least where the callback is created below. We shouldn't care about whether or not a callback was created here, just whether the user has requested that a URL gets handled.