More refactoring of Solver