Index: branches/new_class_id/src/lib/lang/class_id.h
===================================================================
--- branches/new_class_id/src/lib/lang/class_id.h	(revision 9761)
+++ branches/new_class_id/src/lib/lang/class_id.h	(revision 9762)
@@ -47,4 +47,6 @@
   /** @param name the id to compare @returns false on match (match is same Name) @brief compares an ID with a ClassName */
   bool operator!=(const std::string& name) const { return *_name != name; };
+  /** @param classID: the Id to compare @returns true if this id is smaller than the classID's ID */
+  bool operator<(const ClassID& classID) const { return *this->_id < *classID._id; };
 
 private:
Index: branches/new_class_id/src/lib/sound/ogg_player.h
===================================================================
--- branches/new_class_id/src/lib/sound/ogg_player.h	(revision 9761)
+++ branches/new_class_id/src/lib/sound/ogg_player.h	(revision 9762)
@@ -13,5 +13,5 @@
 #include <ogg/ogg.h>
 #include <vorbis/vorbisfile.h>
-#include "threading.h"
+#include "util/threading.h"
 
 struct File;
Index: branches/new_class_id/src/lib/util/loading/factory.cc
===================================================================
--- branches/new_class_id/src/lib/util/loading/factory.cc	(revision 9761)
+++ branches/new_class_id/src/lib/util/loading/factory.cc	(revision 9762)
@@ -35,12 +35,13 @@
   this->setName(classID.name());
 
-  if( Factory::_factoryList == NULL)
-    Factory::_factoryList = new std::list<Factory*>;
-
-  Factory::_factoryList->push_back(this);
+  Factory::_factoryIDMap[classID] = this;
+  Factory::_factoryStringMap[classID.name()] = this;
 }
 
-/** @brief a reference to the First Factory */
-std::list<Factory*>* Factory::_factoryList = NULL;
+/** @brief A Map of all Factories ordered by ID. */
+Factory::FactoryIDMap Factory::_factoryIDMap;
+
+/** @brief A Map of all Factories ordered by Name. */
+Factory::FactoryStringMap Factory::_factoryStringMap;
 
 /**
@@ -49,24 +50,11 @@
 Factory::~Factory ()
 {
-  //  printf("%s\n", this->factoryName);
-  //  Factory* tmpDel = this->next;
-  //  this->next = NULL;
-}
+  FactoryIDMap::iterator it = Factory::_factoryIDMap.find(this->_classID);
+  if (it != Factory::_factoryIDMap.end() && (*it).second == this)
+    Factory::_factoryIDMap.erase(it);
 
-/**
- * @brief deletes all the Factories. (cleanup)
- */
-void Factory::deleteFactories()
-{
-  if (Factory::_factoryList != NULL)
-  {
-    while(!Factory::_factoryList->empty())
-    {
-      delete Factory::_factoryList->front();
-      Factory::_factoryList->pop_front();
-    }
-    delete Factory::_factoryList;
-    Factory::_factoryList = NULL;
-  }
+  FactoryStringMap::iterator stringIt = Factory::_factoryStringMap.find(this->_classID.name());
+  if (stringIt != Factory::_factoryStringMap.end() && (*stringIt).second == this)
+    Factory::_factoryStringMap.erase(stringIt);
 }
 
@@ -99,16 +87,15 @@
 BaseObject* Factory::fabricate(const TiXmlElement* root)
 {
-  assert (Factory::_factoryList != NULL);
-
-  std::list<Factory*>::const_iterator factory;
-  for (factory = Factory::_factoryList->begin(); factory != Factory::_factoryList->end(); factory++)
-    if (*(*factory) == root->Value())
-    {
-      PRINTF(2)("Create a new Object of type %s\n", (*factory)->getCName());
-      return (*factory)->fabricateObject(root);
-    }
-
-  PRINTF(2)("Could not Fabricate an Object of Class '%s'\n", root->Value());
-  return NULL;
+  FactoryStringMap::const_iterator it = Factory::_factoryStringMap.find(root->Value());
+  if (it != Factory::_factoryStringMap.end())
+  {
+    PRINTF(2)("Create a new Object of type %s\n", (*it).second->getCName());
+    return (*it).second->fabricateObject(root);
+  }
+  else
+  {
+    PRINTF(2)("Could not Fabricate an Object of Class '%s'\n", root->Value());
+    return NULL;
+  }
 }
 
@@ -121,16 +108,15 @@
 BaseObject* Factory::fabricate(const std::string& className)
 {
-  if (Factory::_factoryList == NULL)
+  FactoryStringMap::const_iterator it = Factory::_factoryStringMap.find(className);
+  if (it != Factory::_factoryStringMap.end())
+  {
+    PRINTF(2)("Create a new Object of type %s\n", (*it).second->getCName());
+    return (*it).second->fabricateObject(NULL);
+  }
+  else
+  {
+    PRINTF(2)("Could not Fabricate an Object of Class '%s'\n", className.c_str());
     return NULL;
-
-  std::list<Factory*>::const_iterator factory;
-  for (factory = Factory::_factoryList->begin(); factory != Factory::_factoryList->end(); factory++)
-    if (*(*factory) == className)
-    {
-      PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
-      return (*factory)->fabricateObject(NULL);
-    }
-  PRINTF(2)("Could not Fabricate an Object of Class '%s'\n", className.c_str());
-  return NULL;
+  }
 }
 
@@ -142,16 +128,34 @@
 BaseObject* Factory::fabricate(const ClassID& classID)
 {
-  if (Factory::_factoryList == NULL)
+  FactoryIDMap::const_iterator it = Factory::_factoryIDMap.find(classID);
+  if (it != Factory::_factoryIDMap.end())
+  {
+    PRINTF(4)("Create a new Object of type %s\n", (*it).second->getCName());
+    return (*it).second->fabricateObject(NULL);
+  }
+  else
+  {
+    PRINTF(2)("Could not Fabricate an Object of ClassID '%d'\n", classID.id());
     return NULL;
+  }
+}
 
-  std::list<Factory*>::const_iterator factory;
-  for (factory = Factory::_factoryList->begin(); factory != Factory::_factoryList->end(); factory++)
-    if (*(*factory) == classID)
-  {
-    PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
-    return (*factory)->fabricateObject(NULL);
 
-  }
-  PRINTF(2)("Could not Fabricate an Object of ClassID '%d'\n", classID.id());
-  return NULL;
+/**
+ * @brief print out some nice litte debug information about the Factory.
+ */
+void Factory::debug() const
+{
+  PRINTF(0)("Factory of class '%s' with ClassID: %d\n", this->_classID.name().c_str(), this->_classID.id());
 }
+
+/**
+ * @brief Prints out some nice Debug information about all factories
+ */
+void Factory::debugAll()
+{
+  PRINTF(0)("Debugging all %d Factories\n", Factory::_factoryStringMap.size());
+  Factory::FactoryStringMap::const_iterator it;
+  for (it = Factory::_factoryStringMap.begin(); it != Factory::_factoryStringMap.end(); ++it)
+    (*it).second->debug();
+}
Index: branches/new_class_id/src/lib/util/loading/factory.h
===================================================================
--- branches/new_class_id/src/lib/util/loading/factory.h	(revision 9761)
+++ branches/new_class_id/src/lib/util/loading/factory.h	(revision 9762)
@@ -27,5 +27,5 @@
 #include "parser/tinyxml/tinyxml.h"
 #include "base_object.h"
-#include <list>
+#include <map>
 
 /**
@@ -34,14 +34,13 @@
  */
 #define CREATE_FACTORY(CLASS_NAME) \
-    tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(CLASS_NAME::staticClassID())
+    tFactory<CLASS_NAME> global_##CLASS_NAME##_Factory = tFactory<CLASS_NAME>(CLASS_NAME::staticClassID())
 
 //! The Factory is a loadable object handler
 class Factory : public BaseObject
 {
+  //! Declare the ObjectList at the BaseObject List
   ObjectListDeclaration(Factory);
 public:
   virtual ~Factory ();
-
-  static void deleteFactories();
 
   static  BaseObject* fabricate(const std::string& className);
@@ -49,19 +48,35 @@
   static  BaseObject* fabricate(const TiXmlElement* root);
 
-
   bool operator==(int classID) const;
   bool operator==(const std::string& className) const;
+  /** @param classID the ID to compare @returns true if the ID's match */
   bool operator==(const ClassID& classID) const { return _classID == classID; };
+
+
+  void debug() const;
+  static void debugAll();
 
 protected:
   Factory (const ClassID& id);
+  /**
+   * @brief The core function of the Factory. Creates objects of the Factories Type.
+   * @param root The TiXmlElement of the Factory.
+   * @returns the created Object in BaseType* format.
+   */
   virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const = 0;
 
 private:
+  //! Copy Constructor is hidden.
   Factory (const Factory&) {};
 
 protected:
-  const ClassID              _classID;              //!< The Class-Identifyer of the Factory.
-  static std::list<Factory*>*   _factoryList;          //!< List of Registered Factories
+  /** The Type of the FactoryMap that is sorted by ID */
+  typedef std::map<const ClassID, Factory*>  FactoryIDMap;
+  /** The Type of the FactoryMap that is sorted by Name */
+  typedef std::map<std::string, Factory*>    FactoryStringMap;
+
+  const ClassID                 _classID;              //!< The Class-Identifyer of the Factory.
+  static FactoryIDMap           _factoryIDMap;         //!< List of Registered Factories
+  static FactoryStringMap       _factoryStringMap;     //!< List of Registered Factories
 };
 
@@ -75,5 +90,4 @@
   /**
    * @brief creates a new type Factory to enable the loading of T
-   * @param factoryName the Name of the Factory to load.
    * @param classID the ID of the Class to be created.
    */
@@ -81,7 +95,10 @@
       : Factory(classID)
   {  }
+  /**
+   * @brief copy constructor
+   * @param factory the Factory to copy
+   */
+  tFactory (const tFactory& factory) : Factory(factory._classID) {};
 
-private:
-  tFactory (const tFactory&) {};
   /**
    * @brief fabricates an Object of type T, with the constructor T::T(const TiXmlElemnt*)
