Started Main refactoring