diff --git a/apps/remoteStorage/appinfo/info.xml b/apps/remoteStorage/appinfo/info.xml
index fa878762a05a82ca761ba5e9b6ad22b73823b53a..1388ad9c31618374cd457cbe7e9f0993e88ebaa8 100644
--- a/apps/remoteStorage/appinfo/info.xml
+++ b/apps/remoteStorage/appinfo/info.xml
@@ -7,4 +7,7 @@
 	<author>Michiel de Jong</author>
 	<require>4</require>
 	<shipped>true</shipped>
+	<remote>
+		<remoteStorage>webdav.php</remoteStorage>
+	</remote>
 </info>
diff --git a/apps/remoteStorage/appinfo/version b/apps/remoteStorage/appinfo/version
index 490f510fc27c164443c2334282f67bd7034c1698..0e2c93950bb65d053566355a9458a743878b70d8 100644
--- a/apps/remoteStorage/appinfo/version
+++ b/apps/remoteStorage/appinfo/version
@@ -1 +1 @@
-0.6
\ No newline at end of file
+0.7
\ No newline at end of file
diff --git a/apps/remoteStorage/appinfo/webfinger.php b/apps/remoteStorage/appinfo/webfinger.php
index 5d481f315f885f80950b83f7e808723890c03c09..e8b237628c4a6a8a944009754c08f98f03209dc1 100644
--- a/apps/remoteStorage/appinfo/webfinger.php
+++ b/apps/remoteStorage/appinfo/webfinger.php
@@ -1,8 +1,8 @@
-<?php if(OC_User::userExists(WF_USER)) { ?>
+<?php if(OC_User::userExists(WF_USER)): ?>
     {
         "rel":"remoteStorage",
-        "template":"<?php echo WF_BASEURL; ?>/apps/remoteStorage/WebDAV.php/<?php echo WF_USER; ?>/remoteStorage/{category}/",
+        "template":"<?php echo WF_BASEURL; ?>/remote.php/remoteStorage/<?php echo WF_USER; ?>/remoteStorage/{category}/",
         "api":"WebDAV",
         "auth":"<?php echo WF_BASEURL; ?>/?app=remoteStorage&getfile=auth.php&userid=<?php echo WF_USER; ?>"
     }
-<?php } ?>
+<?php endif ?>
diff --git a/apps/remoteStorage/oauth_ro_auth.php b/apps/remoteStorage/oauth_ro_auth.php
index 12d02d1cf5d10b3a94da04a145b50ca73d6ffd29..bed3093c3b3ff1689e2c2bf574cc7ca2ebb0979f 100644
--- a/apps/remoteStorage/oauth_ro_auth.php
+++ b/apps/remoteStorage/oauth_ro_auth.php
@@ -9,10 +9,10 @@
 
 class OC_Connector_Sabre_Auth_ro_oauth extends Sabre_DAV_Auth_Backend_AbstractBasic {
 	private $validTokens;
-  private $category;
+	private $category;
 	public function __construct($validTokensArg, $categoryArg) {
 		$this->validTokens = $validTokensArg;
-    $this->category = $categoryArg;
+		$this->category = $categoryArg;
 	}
 
 	/**
@@ -25,16 +25,16 @@ class OC_Connector_Sabre_Auth_ro_oauth extends Sabre_DAV_Auth_Backend_AbstractBa
 	 */
 	protected function validateUserPass($username, $password){
 		//always give read-only:
-		if(($_SERVER['REQUEST_METHOD'] == 'OPTIONS') 
+		if(($_SERVER['REQUEST_METHOD'] == 'OPTIONS')
 		    || (isset($this->validTokens[$password]))
-        || (($_SERVER['REQUEST_METHOD'] == 'GET') && ($this->category == 'public'))
-        ) {
+			|| (($_SERVER['REQUEST_METHOD'] == 'GET') && ($this->category == 'public'))
+		) {
 			OC_Util::setUpFS();
 			return true;
 		} else {
-      //var_export($_SERVER);
-      //var_export($this->validTokens);
-      //die('not getting in with "'.$username.'"/"'.$password.'"!');
+			//var_export($_SERVER);
+			//var_export($this->validTokens);
+			//die('not getting in with "'.$username.'"/"'.$password.'"!');
 			return false;	
 		}
 	}
@@ -48,8 +48,8 @@ class OC_Connector_Sabre_Auth_ro_oauth extends Sabre_DAV_Auth_Backend_AbstractBa
 		$userpass = $auth->getUserPass();
 		if (!$userpass) {
 			if(($_SERVER['REQUEST_METHOD'] == 'OPTIONS')
-	        ||(($_SERVER['REQUEST_METHOD'] == 'GET') && ($this->category == 'public'))
-          ) {
+				||(($_SERVER['REQUEST_METHOD'] == 'GET') && ($this->category == 'public'))
+			) {
 				$userpass = array('', '');
 			} else {
 				$auth->requireLogin();
diff --git a/apps/remoteStorage/WebDAV.php b/apps/remoteStorage/webdav.php
similarity index 72%
rename from apps/remoteStorage/WebDAV.php
rename to apps/remoteStorage/webdav.php
index 7a81c18e0affd65131083f55cadc467770bb91cb..8d8ec6a45a1cfa4871d897fd1673cdf574be2891 100644
--- a/apps/remoteStorage/WebDAV.php
+++ b/apps/remoteStorage/webdav.php
@@ -25,22 +25,7 @@
 *
 */
 
-
-// Do not load FS ...
-$RUNTIME_NOSETUPFS = true;
-
-
-require_once('../../lib/base.php');
-
-require_once('../../lib/user.php');
-require_once('../../lib/public/user.php');
-
-require_once('../../lib/app.php');
-require_once('../../lib/public/app.php');
-
-require_once('../../3rdparty/Sabre/DAV/Auth/IBackend.php');
-require_once('../../3rdparty/Sabre/DAV/Auth/Backend/AbstractBasic.php');
-require_once('../../lib/connector/sabre/auth.php');
+OC_App::loadApps(array('filesystem','authentication'));
 
 OCP\App::checkAppEnabled('remoteStorage');
 require_once('lib_remoteStorage.php');
@@ -61,14 +46,15 @@ if(isset($_SERVER['HTTP_ORIGIN'])) {
 	header('Access-Control-Allow-Origin: *');
 }
 
-$path = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["SCRIPT_NAME"]));
+$path = substr($_SERVER["REQUEST_URI"], strlen($baseuri));
+
 $pathParts =  explode('/', $path);
 // for webdav:
-// 0/     1       /   2    /   3...
-//  /$ownCloudUser/remoteStorage/$category/
+//      0       /   1    /   2...
+//  $ownCloudUser/remoteStorage/$category/
 
-if(count($pathParts) >= 3 && $pathParts[0] == '') {
-	list($dummy, $ownCloudUser, $dummy2, $category) = $pathParts;
+if(count($pathParts) >= 2) {
+	list($ownCloudUser, $dummy2, $category) = $pathParts;
 
 	OC_Util::setupFS($ownCloudUser);
 
@@ -77,13 +63,13 @@ if(count($pathParts) >= 3 && $pathParts[0] == '') {
 	$server = new Sabre_DAV_Server($publicDir);
 
 	// Path to our script
-	$server->setBaseUri(OC::$WEBROOT."/apps/remoteStorage/WebDAV.php/$ownCloudUser");
+	$server->setBaseUri($baseuri.$ownCloudUser);
 
 	// Auth backend
 	$authBackend = new OC_Connector_Sabre_Auth_ro_oauth(
-      OC_remoteStorage::getValidTokens($ownCloudUser, $category),
-      $category
-      );
+		OC_remoteStorage::getValidTokens($ownCloudUser, $category),
+		$category
+	);
 
 	$authPlugin = new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud');//should use $validTokens here
 	$server->addPlugin($authPlugin);