new Main classes and fixes in the corresponding