optimize iterators and imports in utils lib