add little optimizations in the solver