Updates to use loop-refs and slices