Using smart pointers instead of raw pointers.