Index before callback

This may seem slower, but actually it is not.