moved solver to private helper