Code cleanup and revive ImportInstance.ByGeometry