more refactoring on events