refactor event into a package