Events handling moved to a separate class and tested