We have a `eventutil` module for handling listeners like this, we should open source it so we can leverage it here, makes cleaning up state like this really easy.