Index: code/branches/core5/src/libraries/core/Core.cc
===================================================================
--- code/branches/core5/src/libraries/core/Core.cc	(revision 5875)
+++ code/branches/core5/src/libraries/core/Core.cc	(revision 5876)
@@ -289,5 +289,5 @@
         inputManager_.reset(new InputManager());
 
-        // load the CEGUI interface
+        // Load the CEGUI interface
         guiManager_.reset(new GUIManager(graphicsManager_->getRenderWindow(),
             inputManager_->getMousePosition(), graphicsManager_->isFullScreen()));
@@ -295,4 +295,7 @@
         bGraphicsLoaded_ = true;
         GameMode::bShowsGraphics_s = true;
+
+        // Load some sort of a debug overlay (only denoted by its name, "debug.oxo")
+        graphicsManager_->loadDebugOverlay();
 
         // Create singletons associated with graphics (in other libraries)
Index: code/branches/core5/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/core5/src/libraries/core/GraphicsManager.cc	(revision 5875)
+++ code/branches/core5/src/libraries/core/GraphicsManager.cc	(revision 5876)
@@ -130,4 +130,6 @@
     GraphicsManager::~GraphicsManager()
     {
+        Loader::unload(debugOverlay_.get());
+
         Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_.get());
         // TODO: Destroy the console command
@@ -322,4 +324,20 @@
     }
 
+    void GraphicsManager::loadDebugOverlay()
+    {
+        // Load debug overlay to show info about fps and tick time
+        COUT(4) << "Loading Debug Overlay..." << std::endl;
+        debugOverlay_.reset(new XMLFile("debug.oxo"));
+        Loader::open(debugOverlay_.get());
+    }
+
+    /**
+    @note
+        A note about the Ogre::FrameListener: Even though we don't use them,
+        they still get called. However, the delta times are not correct (except
+        for timeSinceLastFrame, which is the most important). A little research
+        as shown that there is probably only one FrameListener that doesn't even
+        need the time. So we shouldn't run into problems.
+    */
     void GraphicsManager::update(const Clock& time)
     {
Index: code/branches/core5/src/libraries/core/GraphicsManager.h
===================================================================
--- code/branches/core5/src/libraries/core/GraphicsManager.h	(revision 5875)
+++ code/branches/core5/src/libraries/core/GraphicsManager.h	(revision 5876)
@@ -71,4 +71,5 @@
 
         void upgradeToGraphics();
+        void loadDebugOverlay();
         bool rendererLoaded() const { return renderWindow_ != NULL; }
 
@@ -99,7 +100,8 @@
         Ogre::Viewport*     viewport_;                 //!< default full size viewport
 
-        // XML files for the resources
+        // XML files for the resources and the debug overlay
         shared_ptr<XMLFile> resources_;                //!< XML with resource locations
         shared_ptr<XMLFile> extResources_;             //!< XML with resource locations in the external path (only for dev runs)
+        shared_ptr<XMLFile> debugOverlay_;             //!< XML with various debug overlays
 
         // config values
Index: code/branches/core5/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSGraphics.cc	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSGraphics.cc	(revision 5876)
@@ -35,13 +35,8 @@
 #include "GSGraphics.h"
 
-#include "util/Clock.h"
-#include "util/Convert.h"
 #include "core/CommandExecutor.h"
 #include "core/ConsoleCommand.h"
 #include "core/Game.h"
 #include "core/GUIManager.h"
-#include "core/Loader.h"
-#include "core/XMLFile.h"
-
 // HACK:
 #include "overlays/Map.h"
@@ -53,5 +48,4 @@
     GSGraphics::GSGraphics(const GameStateInfo& info)
         : GameState(info)
-        , debugOverlay_(0)
     {
     }
@@ -65,25 +59,11 @@
         This function is called when we enter this game state.
 
-        Since graphics is very important for our game this function does quite a lot:
-        \li starts graphics manager
-        \li loads debug overlay
-        \li manages render window
-        \li creates input manager
-        \li loads master key bindings
-        \li loads the SoundManager
-        \li loads ingame console
-        \li loads GUI interface (GUIManager)
-        \li creates console command to toggle GUI
+        There is only one thing to do here:
+        \li create console command to toggle GUI
     */
     void GSGraphics::activate()
     {
-        // load debug overlay
-        COUT(3) << "Loading Debug Overlay..." << std::endl;
-        this->debugOverlay_ = new XMLFile("debug.oxo");
-        Loader::open(debugOverlay_);
-
         // add console command to toggle GUI
-        this->ccToggleGUI_ = createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI");
-        CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_);
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI"));
     }
 
@@ -91,20 +71,7 @@
     @brief
         This function is called when the game state is left
-
-        Created references, input states and console commands are deleted.
     */
     void GSGraphics::deactivate()
     {
-/*
-        if (this->ccToggleGUI_)
-        {
-            delete this->ccToggleGUI_;
-            this->ccToggleGUI_ = 0;
-        }
-*/
-
-        Loader::unload(this->debugOverlay_);
-        delete this->debugOverlay_;
-
         // HACK: (destroys a resource smart pointer)
         Map::hackDestroyMap();
@@ -123,12 +90,4 @@
     }
 
-    /**
-    @note
-        A note about the Ogre::FrameListener: Even though we don't use them,
-        they still get called. However, the delta times are not correct (except
-        for timeSinceLastFrame, which is the most important). A little research
-        as shown that there is probably only one FrameListener that doesn't even
-        need the time. So we shouldn't run into problems.
-    */
     void GSGraphics::update(const Clock& time)
     {
Index: code/branches/core5/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSGraphics.h	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSGraphics.h	(revision 5876)
@@ -60,6 +60,4 @@
 
     private:
-        XMLFile*              debugOverlay_;
-        ConsoleCommand*       ccToggleGUI_;         //!< Console command to toggle GUI
     };
 }
Index: code/branches/core5/src/orxonox/gamestates/GSIOConsole.cc
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSIOConsole.cc	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSIOConsole.cc	(revision 5876)
@@ -30,6 +30,6 @@
 
 #include <iostream>
-
 #include "core/ConsoleCommand.h"
+#include "core/CommandExecutor.h"
 #include "core/Game.h"
 
@@ -49,19 +49,9 @@
     void GSIOConsole::activate()
     {
-        {
-            this->ccLoadMenu_ = createConsoleCommand(createFunctor(&GSIOConsole::loadMenu, this), "loadMenu");
-            CommandExecutor::addConsoleCommandShortcut(this->ccLoadMenu_);
-        }
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSIOConsole::loadMenu, this), "loadMenu"));
     }
 
     void GSIOConsole::deactivate()
     {
-/*
-        if (this->ccLoadMenu_)
-        {
-            delete this->ccLoadMenu_;
-            this->ccLoadMenu_ = 0;
-        }
-*/
     }
 
Index: code/branches/core5/src/orxonox/gamestates/GSIOConsole.h
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSIOConsole.h	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSIOConsole.h	(revision 5876)
@@ -47,7 +47,4 @@
     private:
         void loadMenu();
-
-        // console commands
-        ConsoleCommand* ccLoadMenu_;
     };
 }
Index: code/branches/core5/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSLevel.cc	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSLevel.cc	(revision 5876)
@@ -37,6 +37,4 @@
 #include "core/input/KeyBinderManager.h"
 #include "core/ConsoleCommand.h"
-#include "core/ConfigValueIncludes.h"
-#include "core/CoreIncludes.h"
 #include "core/Game.h"
 #include "core/GameMode.h"
@@ -51,7 +49,4 @@
 {
     DeclareGameState(GSLevel, "level", false, false);
-    SetConsoleCommand(GSLevel, showIngameGUI, true);
-
-    XMLFile* GSLevel::startFile_s = NULL;
 
     GSLevel::GSLevel(const GameStateInfo& info)
@@ -60,6 +55,6 @@
         , guiMouseOnlyInputState_(0)
         , guiKeysOnlyInputState_(0)
+        , startFile_(0)
     {
-        RegisterObject(GSLevel);
     }
 
@@ -68,12 +63,6 @@
     }
 
-    void GSLevel::setConfigValues()
-    {
-    }
-
     void GSLevel::activate()
     {
-        setConfigValues();
-
         if (GameMode::showsGraphics())
         {
@@ -87,4 +76,6 @@
             guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly");
             guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr());
+
+            CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSLevel::showIngameGUI, this), "showIngameGUI"));
         }
 
@@ -129,14 +120,5 @@
             // unload all compositors (this is only necessary because we don't yet destroy all resources!)
             Ogre::CompositorManager::getSingleton().removeAll();
-        }
 
-        // this call will delete every BaseObject!
-        // But currently this will call methods of objects that exist no more
-        // The only 'memory leak' is the ParticleSpawer. They would be deleted here
-        // and call a sceneNode method that has already been destroy by the corresponding space ship.
-        //Loader::close();
-
-        if (GameMode::showsGraphics())
-        {
             InputManager::getInstance().leaveState("game");
         }
@@ -158,5 +140,5 @@
     void GSLevel::update(const Clock& time)
     {
-        // Note: Temporarily moved to GSGraphics.
+        // Note: Temporarily moved to GSRoot.
         //// Call the scene objects
         //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
@@ -168,13 +150,12 @@
         // call the loader
         COUT(0) << "Loading level..." << std::endl;
-        startFile_s = new XMLFile(LevelManager::getInstance().getDefaultLevel());
-        Loader::open(startFile_s);
+        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
+        Loader::open(startFile_);
     }
 
     void GSLevel::unloadLevel()
     {
-        Loader::unload(startFile_s);
-
-        delete startFile_s;
+        Loader::unload(startFile_);
+        delete startFile_;
     }
 }
Index: code/branches/core5/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSLevel.h	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSLevel.h	(revision 5876)
@@ -38,10 +38,9 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSLevel : public GameState, public OrxonoxClass
+    class _OrxonoxExport GSLevel : public GameState
     {
     public:
         GSLevel(const GameStateInfo& info);
         ~GSLevel();
-        void setConfigValues();
 
         void activate();
@@ -49,15 +48,14 @@
         void update(const Clock& time);
 
-        static void showIngameGUI(bool show);
-
-        static XMLFile* startFile_s;
-
     protected:
         void loadLevel();
         void unloadLevel();
+        void showIngameGUI(bool show);
 
         InputState*              gameInputState_;          //!< input state for normal ingame playing
         InputState*              guiMouseOnlyInputState_;  //!< input state if we only need the mouse to use the GUI
         InputState*              guiKeysOnlyInputState_;   //!< input state if we only need the keys to use the GUI
+
+        XMLFile* startFile_;
     };
 }
Index: code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc	(revision 5876)
@@ -31,5 +31,4 @@
 #include <OgreSceneManager.h>
 
-#include "util/Clock.h"
 #include "core/input/InputManager.h"
 #include "core/input/InputState.h"
@@ -57,7 +56,9 @@
 
         // create an empty Scene
-        this->scene_ = new Scene(0);
+        this->scene_ = new Scene(NULL);
         // and a Camera
         this->camera_ = this->scene_->getSceneManager()->createCamera("mainMenu/Camera");
+        // Load sound
+        this->ambient_ = new SoundMainMenu();
     }
 
@@ -77,19 +78,13 @@
         GraphicsManager::getInstance().setCamera(this->camera_);
 
-        this->ccStartStandalone_ = createConsoleCommand(createFunctor(&GSMainMenu::startStandalone, this), "startGame");
-        CommandExecutor::addConsoleCommandShortcut(this->ccStartStandalone_);
-        this->ccStartServer_ = createConsoleCommand(createFunctor(&GSMainMenu::startServer, this), "startServer");
-        CommandExecutor::addConsoleCommandShortcut(this->ccStartServer_);
-        this->ccStartClient_ = createConsoleCommand(createFunctor(&GSMainMenu::startClient, this), "startClient");
-        CommandExecutor::addConsoleCommandShortcut(this->ccStartClient_);
-        this->ccStartDedicated_ = createConsoleCommand(createFunctor(&GSMainMenu::startDedicated, this), "startDedicated");
-        CommandExecutor::addConsoleCommandShortcut(this->ccStartDedicated_);
-        this->ccStartMainMenu_ = createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu, this), "startMainMenu");
-        CommandExecutor::addConsoleCommandShortcut(this->ccStartMainMenu_);
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startStandalone, this), "startGame"));
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startServer, this), "startServer"));
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startClient, this), "startClient"));
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startDedicated, this), "startDedicated"));
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu, this), "startMainMenu"));
 
         KeyBinderManager::getInstance().setToDefault();
         InputManager::getInstance().enterState("mainMenu");
 
-        this->ambient_ = new SoundMainMenu();
         this->ambient_->play(true);
     }
@@ -97,5 +92,5 @@
     void GSMainMenu::deactivate()
     {
-        this->ambient_->destroy();
+        this->ambient_->stop();
 
         InputManager::getInstance().leaveState("mainMenu");
@@ -103,12 +98,4 @@
         GUIManager::getInstance().setCamera(0);
         GraphicsManager::getInstance().setCamera(0);
-
-/*
-        if (this->ccStartGame_)
-        {
-            delete this->ccStartGame_;
-            this->ccStartGame_ = 0;
-        }
-*/
     }
 
Index: code/branches/core5/src/orxonox/gamestates/GSMainMenu.h
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSMainMenu.h	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSMainMenu.h	(revision 5876)
@@ -58,11 +58,4 @@
         Ogre::Camera*     camera_;
 
-        // console commands
-        ConsoleCommand* ccStartStandalone_;
-        ConsoleCommand* ccStartServer_;
-        ConsoleCommand* ccStartClient_;
-        ConsoleCommand* ccStartDedicated_;
-        ConsoleCommand* ccStartMainMenu_;
-
         // ambient sound for the main menu
         SoundMainMenu* ambient_;
Index: code/branches/core5/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSRoot.cc	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSRoot.cc	(revision 5876)
@@ -48,6 +48,4 @@
         , timeFactorPauseBackup_(1.0f)
     {
-        this->ccSetTimeFactor_ = 0;
-        this->ccPause_ = 0;
     }
 
@@ -63,27 +61,14 @@
 
         // time factor console command
-        this->ccSetTimeFactor_ = createConsoleCommand(createFunctor(&GSRoot::setTimeFactor, this), "setTimeFactor");
-        CommandExecutor::addConsoleCommandShortcut(this->ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);
+        ConsoleCommand* command = createConsoleCommand(createFunctor(&GSRoot::setTimeFactor, this), "setTimeFactor");
+        CommandExecutor::addConsoleCommandShortcut(command).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);
 
         // time factor console command
-        this->ccPause_ = createConsoleCommand(createFunctor(&GSRoot::pause, this), "pause");
-        CommandExecutor::addConsoleCommandShortcut(this->ccPause_).accessLevel(AccessLevel::Offline);
+        command = createConsoleCommand(createFunctor(&GSRoot::pause, this), "pause");
+        CommandExecutor::addConsoleCommandShortcut(command).accessLevel(AccessLevel::Offline);
     }
 
     void GSRoot::deactivate()
     {
-/*
-        if (this->ccSetTimeFactor_)
-        {
-            delete this->ccSetTimeFactor_;
-            this->ccSetTimeFactor_ = 0;
-        }
-
-        if (this->ccPause_)
-        {
-            delete this->ccPause_;
-            this->ccPause_ = 0;
-        }
-*/
     }
 
Index: code/branches/core5/src/orxonox/gamestates/GSRoot.h
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSRoot.h	(revision 5875)
+++ code/branches/core5/src/orxonox/gamestates/GSRoot.h	(revision 5876)
@@ -55,8 +55,4 @@
         bool                  bPaused_;
         float                 timeFactorPauseBackup_;
-
-        // console commands
-        ConsoleCommand*       ccSetTimeFactor_;
-        ConsoleCommand*       ccPause_;
     };
 }
