Added functionality add event, some refactoring