replace ArrayList with ArraySlice