mescc: Factor-out array-ref.