Main: Refactoring