Refactoring of listeners