Reorganized the project by refactoring MainActivity