[FEATURE] allow shared_ptr return type

Also allow to return a shared_ptr to an object