Solver refactor