Wrapping event call in a function