Solver refactoring