Refactor listeners