More robust registry setup