Some refactoring in SAT solver.