refactoring listeners