added event handling to factory.
factory events
linted