diff --git a/admin/appinfo.php b/admin/appinfo/app.php
similarity index 85%
rename from admin/appinfo.php
rename to admin/appinfo/app.php
index 0b2e4dbf85d2eb609899ae500d57e58b0dbfe36a..befe8e678f0ad79cd15fb0b229b44d8d9cadf26d 100644
--- a/admin/appinfo.php
+++ b/admin/appinfo/app.php
@@ -1,6 +1,6 @@
 <?php
 
-OC_UTIL::addApplication( array( "id" => "admin", "name" => "Administration" ));
+OC_APP::register( array( "id" => "admin", "name" => "Administration" ));
 if( OC_USER::ingroup( $_SESSION['username'], 'admin' ))
 {
 	OC_UTIL::addNavigationEntry( array( "app" => "admin", "file" => "index.php", "name" => "Administration" ));
diff --git a/admin/index.php b/admin/index.php
index cfcb70d056b6a7498cb9276b7f34a6cf4a8c68db..96fa20072441b5779227dc7336403bc4cb6ce58c 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -30,7 +30,7 @@ if( !OC_USER::isLoggedIn() || !OC_USER::ingroup( $_SESSION['username'], 'admin'
 
 $adminpages = array();
 
-foreach( OC_UTIL::$adminpages as $i ){
+foreach( OC_APP::list() as $i ){
 	// Do some more work here soon
 	$adminpages[] = $i;
 }
diff --git a/files/appinfo.php b/files/appinfo.php
deleted file mode 100644
index 44a533cf4a09a14ac812b69dcdf0d1f503718a0c..0000000000000000000000000000000000000000
--- a/files/appinfo.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-OC_UTIL::addApplication( array( "id" => "files", "name" => "Files" ));
-OC_UTIL::addNavigationEntry( array( "app" => "files", "file" => "index.php", "name" => "Files" ));
-
-?>
diff --git a/files/appinfo/app.php b/files/appinfo/app.php
new file mode 100644
index 0000000000000000000000000000000000000000..aa0054fc43da4760a3b86addd681b3479d4e8e88
--- /dev/null
+++ b/files/appinfo/app.php
@@ -0,0 +1,7 @@
+<?php
+
+OC_APP::register( array( "id" => "files", "name" => "Files" ));
+OC_UTIL::addNavigationEntry( array( "app" => "files", "file" => "index.php", "name" => "Files" ));
+OC_UTIL::addAdminPage( array( "app" => "files", "file" => "admin.php", "name" => "Files" ));
+
+?>
diff --git a/lib/app.php b/lib/app.php
new file mode 100644
index 0000000000000000000000000000000000000000..181af8a4faf57f4a233a9e6863818b52418e7da8
--- /dev/null
+++ b/lib/app.php
@@ -0,0 +1,40 @@
+<?php
+class OC_APP{
+	static private $init = false;
+	static private $apps = array();
+
+	/**
+	 *
+	 */
+	public static function init(){
+		// Get all appinfo
+		$dir = opendir( $SERVERROOT );
+		while( false !== ( $filename = readdir( $dir ))){
+			if( substr( $filename, 0, 1 ) != '.' ){
+				if( file_exists( "$SERVERROOT/$filename/appinfo.php" )){
+					oc_require( "$filename/appinfo.php" );
+				}
+			}
+		}
+		closedir( $dir );
+
+		// return
+		return true;
+	}
+
+	/**
+	 *
+	 */
+	public static function register( $data = array()){
+		OC_APP::$apps[] = $data;
+	}
+
+	/**
+	 *
+	 */
+	public static function list(){
+		return OC_APP::$apps[];
+	}
+
+}
+?>
diff --git a/lib/appconfig.php b/lib/appconfig.php
index f1bccc0a250671f19507936e601bec2f5d9ccf2a..844d4cf54e8471c670a123866e4dc106f4c8adad 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -1,16 +1,5 @@
 <?php
 class OC_APPCONFIG{
-	static public $forms=array();
-
-	/**
-	 * add a form to the settings page
-	 * @param string name
-	 * @param string url
-	 */
-	public static function addForm($name,$url){
-		self::$forms[$name]=$url;
-	}
-
 	/**
 	 * Get the available keys for an application
 	 * @param string application
diff --git a/lib/base.php b/lib/base.php
index e379a4ba618cf6f60ea300f0c11a196dcd1f5aea..c7f0fea6820d065e51be80e4f1eefe634e0fb66c 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -77,6 +77,7 @@ if(isset($CONFIG_HTTPFORCESSL) and $CONFIG_HTTPFORCESSL){
 }
 
 // load core libs
+oc_require_once('app.php');
 oc_require_once('files.php');
 oc_require_once('filesystem.php');
 oc_require_once('filestorage.php');
@@ -90,7 +91,7 @@ oc_require_once('remotestorage.php');
 oc_require_once('plugin.php');
 oc_require_once('helper.php');
 
-OC_PLUGIN::loadPlugins();
+OC_PLUGIN::loadPlugins( "" );
 
 if(!isset($CONFIG_BACKEND)){
 	$CONFIG_BACKEND='database';
@@ -111,17 +112,7 @@ OC_UTIL::addStyle( "jquery-ui-1.8.10.custom" );
 OC_UTIL::addStyle( "styles" );
 
 // Require all appinfo.php
-$dir = opendir( $SERVERROOT );
-while( false !== ( $filename = readdir( $dir ))){
-	if( substr( $filename, 0, 1 ) != '.' ){
-		if( file_exists( "$SERVERROOT/$filename/appinfo.php" )){
-			oc_require( "$filename/appinfo.php" );
-		}
-	}
-}
-closedir( $dir );
-
-
+OC_APP::init();
 
 // check if the server is correctly configured for ownCloud
 OC_UTIL::checkserver();
@@ -134,7 +125,6 @@ class OC_UTIL {
 	public static $scripts=array();
 	public static $styles=array();
 	public static $adminpages = array();
-	public static $applications = array();
 	public static $navigation = array();
 	public static $personalmenu = array();
 	private static $fsSetup=false;
@@ -169,7 +159,7 @@ class OC_UTIL {
 			if($CONFIG_ENABLEBACKUP){
 				// This creates the Directorys recursively
 				if(!is_dir( "$CONFIG_BACKUPDIRECTORY/$user/$root" )){
-					mkdir( "$CONFIG_BACKUPDIRECTORY/$user/$root", 0x777, true );
+					mkdir( "$CONFIG_BACKUPDIRECTORY/$user/$root", 0x755, true );
 				}
 				$backupStorage=OC_FILESYSTEM::createStorage('local',array('datadir'=>$CONFIG_BACKUPDIRECTORY));
 				$backup=new OC_FILEOBSERVER_BACKUP(array('storage'=>$backupStorage));
@@ -179,7 +169,7 @@ class OC_UTIL {
 
 			$CONFIG_DATADIRECTORY = "$CONFIG_DATADIRECTORY_ROOT/$user/$root";
 			if( !is_dir( $CONFIG_DATADIRECTORY )){
-				mkdir( $CONFIG_DATADIRECTORY, 0x777, true );
+				mkdir( $CONFIG_DATADIRECTORY, 0x755, true );
 			}
 
 			//set up the other storages according to the system settings
@@ -253,15 +243,6 @@ class OC_UTIL {
 		OC_UTIL::$adminpages[] = $entry;
 	}
 
-	/**
-	 * add application
-	 *
-	 * @param array $entry
-	 */
-	public static function addApplication( $entry){
-		OC_UTIL::$applications[] = $entry;
-	}
-
 	/**
 	 * add an entry to the personal menu
 	 *
diff --git a/lib/preferences.php b/lib/preferences.php
new file mode 100644
index 0000000000000000000000000000000000000000..bd4ff55cc5c6a2c74079819a550d804da703319e
--- /dev/null
+++ b/lib/preferences.php
@@ -0,0 +1,35 @@
+<?php
+class OC_PREFERENCES{
+	static public $forms=array();
+	/**
+	 * Get the available keys for an application
+	 * @param string application
+	 */
+	public static function getKeys( $user, $application ){
+		// OC_DB::query( $query);
+		return array();
+	}
+
+	/**
+	 * Get the config value
+	 * @param string application
+	 * @param string key
+	 * @param string default
+	 */
+	public static function getValue( $user, $application, $key, $default ){
+		// OC_DB::query( $query);
+		return $default;
+	}
+
+	/**
+	 * Set the config value
+	 * @param string application
+	 * @param string key
+	 * @param string value
+	 */
+	public static function setValue( $user, $application, $name, $url ){
+		// OC_DB::query( $query);
+		return true;
+	}
+}
+?>
diff --git a/log/appinfo.php b/log/appinfo/app.php
similarity index 61%
rename from log/appinfo.php
rename to log/appinfo/app.php
index e4ffa79efe1bfc48f7654639d91d7809eca6ec0b..292d59ee578478ca08bfee865fa0a3ce493763e8 100644
--- a/log/appinfo.php
+++ b/log/appinfo/app.php
@@ -1,6 +1,6 @@
 <?php
 
-OC_UTIL::addApplication( array( "id" => "log", "name" => "Log" ));
+OC_APP::register( array( "id" => "log", "name" => "Log" ));
 OC_UTIL::addNavigationEntry( array( "app" => "log", "file" => "index.php", "name" => "Log" ));
 
 ?>
diff --git a/settings/appinfo.php b/settings/appinfo/app.php
similarity index 60%
rename from settings/appinfo.php
rename to settings/appinfo/app.php
index 232aaa0f0e75d2aeaa572363a0d193cbc49bbe44..0db99441574f4da954cba4c2124bbe3eac68bd38 100644
--- a/settings/appinfo.php
+++ b/settings/appinfo/app.php
@@ -1,6 +1,6 @@
 <?php
 
-OC_UTIL::addApplication( array( "id" => "settings", "name" => "Settings" ));
+OC_APP::register( array( "id" => "settings", "name" => "Settings" ));
 OC_UTIL::addNavigationEntry( array( "app" => "settings", "file" => "index.php", "name" => "Settings" ));
 
 ?>