Simplification of main method