Refactoring code on the class Main
Refactor the class main