diff --git a/core/avatar/controller.php b/core/avatar/controller.php
index d0edde506476eb42febd8af3955d9bb680792637..43ee811f19107dba7dbef83d59d3fa52aced5531 100644
--- a/core/avatar/controller.php
+++ b/core/avatar/controller.php
@@ -6,7 +6,9 @@
  * See the COPYING-README file.
  */
 
-class OC_Core_Avatar_Controller {
+namespace OC\Core\Avatar;
+
+class Controller {
 	public static function getAvatar($args) {
 		if (!\OC_User::isLoggedIn()) {
 			$l = new \OC_L10n('core');
@@ -91,7 +93,7 @@ class OC_Core_Avatar_Controller {
 	}
 
 	public static function deleteAvatar($args) {
-		$user = OC_User::getUser();
+		$user = \OC_User::getUser();
 
 		try {
 			$avatar = new \OC_Avatar();
@@ -118,7 +120,7 @@ class OC_Core_Avatar_Controller {
 	}
 
 	public static function postCroppedAvatar($args) {
-		$user = OC_User::getUser();
+		$user = \OC_User::getUser();
 		if (isset($_POST['crop'])) {
 			$crop = $_POST['crop'];
 		} else {
diff --git a/core/routes.php b/core/routes.php
index 9cedcb0956cfc18368f97d6e4af603c53afaf688..388fa934c4d2fb2bdd99050c7058ef95e66f20a2 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -61,19 +61,19 @@ $this->create('core_lostpassword_reset_password', '/lostpassword/reset/{token}/{
 // Avatar routes
 $this->create('core_avatar_get_tmp', '/avatar/tmp')
 	->get()
-	->action('OC_Core_Avatar_Controller', 'getTmpAvatar');
+	->action('OC\Core\Avatar\Controller', 'getTmpAvatar');
 $this->create('core_avatar_get', '/avatar/{user}/{size}')
 	->get()
-	->action('OC_Core_Avatar_Controller', 'getAvatar');
+	->action('OC\Core\Avatar\Controller', 'getAvatar');
 $this->create('core_avatar_post', '/avatar/')
 	->post()
-	->action('OC_Core_Avatar_Controller', 'postAvatar');
+	->action('OC\Core\Avatar\Controller', 'postAvatar');
 $this->create('core_avatar_delete', '/avatar/')
 	->delete()
-	->action('OC_Core_Avatar_Controller', 'deleteAvatar');
+	->action('OC\Core\Avatar\Controller', 'deleteAvatar');
 $this->create('core_avatar_post_cropped', '/avatar/cropped')
 	->post()
-	->action('OC_Core_Avatar_Controller', 'postCroppedAvatar');
+	->action('OC\Core\Avatar\Controller', 'postCroppedAvatar');
 
 // Not specifically routed
 $this->create('app_css', '/apps/{app}/{file}')