Restructure solver interface. We need to have an abstract type.