Refactor LocalArray.global_index