Replace many shared_ptrs by unique_ptrs.
Infer iterator types.