optimized some iterations