shouldn't this code be rewritten to use `Instance::ensure`?