Remove some unnecessary loop variables