refactor listeners