Main class and a eventhandler