Improve Ops.index to make nicer code