clean up shared_ptr usage in HeadlessView