Rename block_ter to iter_blocks and refactor.