def METHOD_NAME(self, old, new):
    if old:
        old.observe(self._new_value_updated, "new_value", remove=True)
        old.observe(self._tool_visible_changed, "visible", remove=True)
    if new:
        new.observe(self._new_value_updated, "new_value")
        new.observe(self._tool_visible_changed, "visible")
        self._tool_visible_changed()