Use event handler, remove global ref