Simplify loop