Removing unnecessary iterator variable