loop simplifications