Refactor ArrayIndexList's remove method