refuctoring Main.class