improved solver class