Cleanup, convert wrappers to shared_ptr