patches: add use shared pointers in source file