Refactoring of Event system