refactor into separate events