Refactors with solution.