remove repeated loop