Restructuring of main