reorganising the Main class