refactor interfaces of iterator