MainFile refactoring