fix create/destroy to make it more ffi friendly