Change shared pointer copy to auto reference