generic solver class