refacto boucle for