add registry.ex and registry_test.ex