Simplify loops.