Index: trunk/src/lib/util/loading/factory.cc
===================================================================
--- trunk/src/lib/util/loading/factory.cc	(revision 9406)
+++ trunk/src/lib/util/loading/factory.cc	(revision 9675)
@@ -29,5 +29,5 @@
  */
 Factory::Factory (const std::string& factoryName, ClassID classID)
-  : classID(classID), className(factoryName)
+    : classID(classID), className(factoryName)
 {
   this->setClassID(CL_FACTORY, "Factory");
@@ -86,5 +86,5 @@
 bool Factory::operator==(const char* className) const
 {
-  return(className != NULL && this->className == className);
+  return (className != NULL && this->className == className);
 }
 
@@ -96,5 +96,5 @@
 bool Factory::operator==(const std::string& className) const
 {
-  return(this->className == className);
+  return (this->className == className);
 }
 
@@ -105,33 +105,27 @@
  * @returns a new Object of Type root->Value() on match, NULL otherwise
  */
- BaseObject* Factory::fabricate(const TiXmlElement* root)
+BaseObject* Factory::fabricate(const TiXmlElement* root)
 {
-  if (root == NULL || Factory::factoryList == NULL)
-    return NULL;
+  assert (root != NULL && Factory::factoryList != NULL);
 
   std::list<Factory*>::const_iterator factory;
   for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++)
     if (*(*factory) == root->Value())
-      break;
+    {
+      PRINTF(2)("Create a new Object of type %s\n", (*factory)->getCName());
+      return (*factory)->fabricateObject(root);
+    }
 
-  if (factory != Factory::factoryList->end())
-  {
-    PRINTF(2)("Create a new Object of type %s\n", (*factory)->getCName());
-    return (*factory)->fabricateObject(root);
-  }
-  else
-  {
-    PRINTF(2)("Could not Fabricate an Object of Class '%s'\n", root->Value());
-    return NULL;
-  }
+  PRINTF(2)("Could not Fabricate an Object of Class '%s'\n", root->Value());
+  return NULL;
 }
 
 
 /**
- * Creates a new Object of type className
+ * @brief Creates a new Object of type className
  * @param className the ClassName to match for the newly created Object
  * @returns a new Object of Type className on match, NULL otherwise
  */
- BaseObject* Factory::fabricate(const std::string& className)
+BaseObject* Factory::fabricate(const std::string& className)
 {
   if (Factory::factoryList == NULL)
@@ -141,21 +135,15 @@
   for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++)
     if (*(*factory) == className)
-      break;
-
-  if (factory != Factory::factoryList->end())
-  {
-    PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
-    return (*factory)->fabricateObject(NULL);
-  }
-  else
-  {
-    PRINTF(2)("Could not Fabricate an Object of Class '%s'\n", className.c_str());
-    return NULL;
-  }
+    {
+      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;
 }
 
 
 /**
- * Creates a new Object of type classID
+ * @brief Creates a new Object of type classID
  * @param classID the ClassID to match for the newly created Object
  * @returns a new Object of Type classID on match, NULL otherwise
@@ -169,15 +157,10 @@
   for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++)
     if (*(*factory) == classID)
-      break;
+    {
+      PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
+      return (*factory)->fabricateObject(NULL);
 
-  if (factory != Factory::factoryList->end())
-  {
-    PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
-    return (*factory)->fabricateObject(NULL);
-  }
-  else
-  {
-    PRINTF(2)("Could not Fabricate an Object of ClassID '0x%h'\n", classID);
-    return NULL;
-  }
+    }
+  PRINTF(2)("Could not Fabricate an Object of ClassID '0x%h'\n", classID);
+  return NULL;
 }
