refactor internal iterative deepening