add a class factory and make TFSingleton useable