factored out the rmiregistry