Issue #23: Use iterator for index command