Refractoring Solve method with files connected