Completed refactoring to listeners.