Refactoring of solvers into classes