simpler way to register singleton instances.