Removed chunkediterator code duplication