added createRegistry as global function