Use `toArray` to remove duplication

`list.slice()` is defined in `toArray`.