triggerevent refactor