Cleaning, refactoring
Using native node events handler