refactors triggerEvent method
Merge pull request #3 from dadadel/master

refactors triggerEvent method