simplify listen logic