clean some code in Solver