Move repeat to local variable