Refactor - implementations of the listeners.