add once, listeners, and simplify logic