refactor parser.java class

-first commit
-refactor the methods call in the main method