Refactoring of combinatory method

Also make Solver abstract instead of interface