Optimized the looping branch structure