Splitted main into smaller functions.
Splitted main into smaller functions.

mshravanreddi/effectivejava,ftomassetti/effectivejava,ftomassetti/effectivejava,mshravanreddi/effectivejava,dushmis/effectivejava,dushmis/effectivejava