adapt to new APIs and modify iterative algorithms