[lib] now uses an event emitter, code