refactor listeners tests