Refactoring on the Solver