Deepcopy: simplify by replacing index with id.