refactor out shared events