Simplify code a bit: inline a listener.