Created proper class
Fixed exit condition

Get rid from event in the class