diff --git a/src/App.php b/src/App.php
index df15bf095e..4564bb0980 100644
--- a/src/App.php
+++ b/src/App.php
@@ -58,10 +58,6 @@ class App
 {
 	public $user;
 	public $data = [];
-	/** @deprecated 2019.09 - use App\Arguments->getArgv() or Arguments->get() */
-	public $argv;
-	/** @deprecated 2019.09 - use App\Arguments->getArgc() */
-	public $argc;
 	public $theme_info = [];
 	// Allow themes to control internal parameters
 	// by changing App values in theme.php
@@ -254,9 +250,6 @@ class App
 		$this->process  = $process;
 		$this->pConfig  = $pConfig;
 
-		$this->argv         = $args->getArgv();
-		$this->argc         = $args->getArgc();
-
 		$this->load();
 	}
 
diff --git a/src/Module/Attach.php b/src/Module/Attach.php
index 2acbf31b42..d9a6d9f64c 100644
--- a/src/Module/Attach.php
+++ b/src/Module/Attach.php
@@ -37,12 +37,11 @@ class Attach extends BaseModule
 	public static function rawContent(array $parameters = [])
 	{
 		$a = DI::app();
-		if ($a->argc != 2) {
+		if (empty($parameters['item'])) {
 			throw new \Friendica\Network\HTTPException\BadRequestException();
 		}
 
-		// @TODO: Replace with parameter from router
-		$item_id = intval($a->argv[1]);
+		$item_id = intval($parameters['item']);
 
 		// Check for existence
 		$item = MAttach::exists(['id' => $item_id]);
diff --git a/src/Module/BaseSettings.php b/src/Module/BaseSettings.php
index 4baceee856..c2516e134c 100644
--- a/src/Module/BaseSettings.php
+++ b/src/Module/BaseSettings.php
@@ -42,21 +42,21 @@ class BaseSettings extends BaseModule
 		$tabs[] = [
 			'label' => DI::l10n()->t('Account'),
 			'url' => 'settings',
-			'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() == 1) && (DI::args()->getArgv() === 'settings') ? 'active' : ''),
 			'accesskey' => 'o',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Two-factor authentication'),
 			'url' => 'settings/2fa',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === '2fa') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === '2fa') ? 'active' : ''),
 			'accesskey' => 'o',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Profile'),
 			'url' => 'settings/profile',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === 'profile') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'profile') ? 'active' : ''),
 			'accesskey' => 'p',
 		];
 
@@ -64,7 +64,7 @@ class BaseSettings extends BaseModule
 			$tabs[] = [
 				'label' => DI::l10n()->t('Additional features'),
 				'url' => 'settings/features',
-				'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
+				'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'features') ? 'active' : ''),
 				'accesskey' => 't',
 			];
 		}
@@ -72,49 +72,49 @@ class BaseSettings extends BaseModule
 		$tabs[] = [
 			'label' => DI::l10n()->t('Display'),
 			'url' => 'settings/display',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === 'display') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'display') ? 'active' : ''),
 			'accesskey' => 'i',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Social Networks'),
 			'url' => 'settings/connectors',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'connectors') ? 'active' : ''),
 			'accesskey' => 'w',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Addons'),
 			'url' => 'settings/addon',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'addon') ? 'active' : ''),
 			'accesskey' => 'l',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Manage Accounts'),
 			'url' => 'settings/delegation',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === 'delegation') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'delegation') ? 'active' : ''),
 			'accesskey' => 'd',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Connected apps'),
 			'url' => 'settings/oauth',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'oauth') ? 'active' : ''),
 			'accesskey' => 'b',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Export personal data'),
 			'url' => 'settings/userexport',
-			'selected' => (($a->argc > 1) && ($a->argv[1] === 'userexport') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'userexport') ? 'active' : ''),
 			'accesskey' => 'e',
 		];
 
 		$tabs[] = [
 			'label' => DI::l10n()->t('Remove account'),
 			'url' => 'removeme',
-			'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme') ? 'active' : ''),
+			'selected' => ((DI::args()->getArgc() == 1) && (DI::args()->getArgv() === 'removeme') ? 'active' : ''),
 			'accesskey' => 'r',
 		];
 
diff --git a/src/Module/Contact.php b/src/Module/Contact.php
index 6aa602af2f..1ca681a1eb 100644
--- a/src/Module/Contact.php
+++ b/src/Module/Contact.php
@@ -106,13 +106,13 @@ class Contact extends BaseModule
 		}
 
 		// @TODO: Replace with parameter from router
-		if ($a->argv[1] === 'batch') {
+		if (DI::args()->getArgv()[1] === 'batch') {
 			self::batchActions();
 			return;
 		}
 
 		// @TODO: Replace with parameter from router
-		$contact_id = intval($a->argv[1]);
+		$contact_id = intval(DI::args()->getArgv()[1]);
 		if (!$contact_id) {
 			return;
 		}
@@ -271,10 +271,10 @@ class Contact extends BaseModule
 
 		$contact = null;
 		// @TODO: Replace with parameter from router
-		if ($a->argc == 2 && intval($a->argv[1])
-			|| $a->argc == 3 && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])
+		if (DI::args()->getArgc() == 2 && intval(DI::args()->getArgv()[1])
+			|| DI::args()->getArgc() == 3 && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations'])
 		) {
-			$contact_id = intval($a->argv[1]);
+			$contact_id = intval(DI::args()->getArgv()[1]);
 
 			// Ensure to use the user contact when the public contact was provided
 			$data = Model\Contact::getPublicAndUserContactID($contact_id, local_user());
@@ -293,7 +293,7 @@ class Contact extends BaseModule
 		if (DBA::isResult($contact)) {
 			if ($contact['self']) {
 				// @TODO: Replace with parameter from router
-				if (($a->argc == 3) && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])) {
+				if ((DI::args()->getArgc() == 3) && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations'])) {
 					DI::baseUrl()->redirect('profile/' . $contact['nick']);
 				} else {
 					DI::baseUrl()->redirect('profile/' . $contact['nick'] . '/profile');
@@ -343,14 +343,14 @@ class Contact extends BaseModule
 			return Login::form();
 		}
 
-		if ($a->argc == 3) {
-			$contact_id = intval($a->argv[1]);
+		if (DI::args()->getArgc() == 3) {
+			$contact_id = intval(DI::args()->getArgv()[1]);
 			if (!$contact_id) {
 				throw new BadRequestException();
 			}
 
 			// @TODO: Replace with parameter from router
-			$cmd = $a->argv[2];
+			$cmd = DI::args()->getArgv()[2];
 
 			$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false, 'deleted' => false]);
 			if (!DBA::isResult($orig_record)) {
@@ -637,7 +637,7 @@ class Contact extends BaseModule
 		$sql_values = [local_user()];
 
 		// @TODO: Replace with parameter from router
-		$type = $a->argv[1] ?? '';
+		$type = DI::args()->getArgv()[1] ?? '';
 
 		switch ($type) {
 			case 'blocked':
diff --git a/src/Module/Debug/ItemBody.php b/src/Module/Debug/ItemBody.php
index 25734f2c86..2299b3cb21 100644
--- a/src/Module/Debug/ItemBody.php
+++ b/src/Module/Debug/ItemBody.php
@@ -23,7 +23,6 @@ namespace Friendica\Module\Debug;
 
 use Friendica\BaseModule;
 use Friendica\DI;
-use Friendica\Model\Item;
 use Friendica\Model\Post;
 use Friendica\Network\HTTPException;
 
@@ -38,16 +37,13 @@ class ItemBody extends BaseModule
 			throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
 		}
 
-		$app = DI::app();
-
-		// @TODO: Replace with parameter from router
-		$itemId = (($app->argc > 1) ? intval($app->argv[1]) : 0);
-
-		if (!$itemId) {
+		if (empty($parameters['item'])) {
 			throw new HTTPException\NotFoundException(DI::l10n()->t('Item not found.'));
 		}
 
-		$item = Post::selectFirst(['body'], ['uid' => local_user(), 'uri-id' => $itemId]);
+		$itemId = intval($parameters['item']);
+
+		$item = Post::selectFirst(['body'], ['uid' => [0, local_user()], 'uri-id' => $itemId]);
 
 		if (!empty($item)) {
 			if (DI::mode()->isAjax()) {
diff --git a/src/Module/Diaspora/Fetch.php b/src/Module/Diaspora/Fetch.php
index 09e5901cae..17f664baf8 100644
--- a/src/Module/Diaspora/Fetch.php
+++ b/src/Module/Diaspora/Fetch.php
@@ -40,15 +40,11 @@ class Fetch extends BaseModule
 {
 	public static function rawContent(array $parameters = [])
 	{
-		$app = DI::app();
-
-		// @TODO: Replace with parameter from router
-		if (($app->argc != 3) || (!in_array($app->argv[1], ["post", "status_message", "reshare"]))) {
+		if (empty($parameters['guid'])) {
 			throw new HTTPException\NotFoundException();
 		}
 
-		// @TODO: Replace with parameter from router
-		$guid = $app->argv[2];
+		$guid = $parameters['guid'];
 
 		// Fetch the item
 		$fields = [
@@ -68,7 +64,7 @@ class Fetch extends BaseModule
 				$host = $parts["scheme"] . "://" . $parts["host"];
 
 				if (Strings::normaliseLink($host) != Strings::normaliseLink(DI::baseUrl()->get())) {
-					$location = $host . "/fetch/" . $app->argv[1] . "/" . urlencode($guid);
+					$location = $host . "/fetch/" . DI::args()->getArgv()[1] . "/" . urlencode($guid);
 					System::externalRedirect($location, 301);
 				}
 			}
diff --git a/src/Module/Directory.php b/src/Module/Directory.php
index b5c8e254f4..3c2f66ec11 100644
--- a/src/Module/Directory.php
+++ b/src/Module/Directory.php
@@ -76,12 +76,6 @@ class Directory extends BaseModule
 		if ($profiles['total'] === 0) {
 			notice(DI::l10n()->t('No entries (some entries may be hidden).'));
 		} else {
-			if (in_array('small', $app->argv)) {
-				$photo = 'thumb';
-			} else {
-				$photo = 'photo';
-			}
-
 			foreach ($profiles['entries'] as $entry) {
 				$contact = Model\Contact::getByURLForUser($entry['url'], local_user());
 				if (!empty($contact)) {
diff --git a/src/Module/Feed.php b/src/Module/Feed.php
index 2a3c6de5a7..788f9da7c2 100644
--- a/src/Module/Feed.php
+++ b/src/Module/Feed.php
@@ -48,15 +48,10 @@ class Feed extends BaseModule
 		$last_update = $_GET['last_update'] ?? '';
 		$nocache     = !empty($_GET['nocache']) && local_user();
 
-		// @TODO: Replace with parameter from router
-		if ($a->argc < 2) {
-			throw new \Friendica\Network\HTTPException\BadRequestException();
-		}
-
 		$type = null;
 		// @TODO: Replace with parameter from router
-		if ($a->argc > 2) {
-			$type = $a->argv[2];
+		if (DI::args()->getArgc() > 2) {
+			$type = DI::args()->getArgv()[2];
 		}
 
 		switch ($type) {
@@ -72,10 +67,8 @@ class Feed extends BaseModule
 				$type = 'posts';
 		}
 
-		// @TODO: Replace with parameter from router
-		$nickname = $a->argv[1];
 		header("Content-type: application/atom+xml; charset=utf-8");
-		echo ProtocolFeed::atom($nickname, $last_update, 10, $type, $nocache, true);
+		echo ProtocolFeed::atom($parameters['nickname'], $last_update, 10, $type, $nocache, true);
 		exit();
 	}
 }
diff --git a/src/Module/Filer/RemoveTag.php b/src/Module/Filer/RemoveTag.php
index 667bc390c3..8c65f43814 100644
--- a/src/Module/Filer/RemoveTag.php
+++ b/src/Module/Filer/RemoveTag.php
@@ -39,10 +39,9 @@ class RemoveTag extends BaseModule
 			throw new HTTPException\ForbiddenException();
 		}
 
-		$app = DI::app();
 		$logger = DI::logger();
 
-		$item_id = (($app->argc > 1) ? intval($app->argv[1]) : 0);
+		$item_id = $parameters['id'] ?? 0;
 
 		$term = XML::unescape(trim($_GET['term'] ?? ''));
 		$cat = XML::unescape(trim($_GET['cat'] ?? ''));
diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php
index 013ff565a5..50f6c2e9b1 100644
--- a/src/Module/Filer/SaveTag.php
+++ b/src/Module/Filer/SaveTag.php
@@ -44,12 +44,11 @@ class SaveTag extends BaseModule
 
 	public static function rawContent(array $parameters = [])
 	{
-		$a = DI::app();
 		$logger = DI::logger();
 
 		$term = XML::unescape(trim($_GET['term'] ?? ''));
-		// @TODO: Replace with parameter from router
-		$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+
+		$item_id = $parameters['id'] ?? 0;
 
 		$logger->info('filer', ['tag' => $term, 'item' => $item_id]);
 
diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php
index 0fd7445b15..5e77eb00fb 100644
--- a/src/Module/Friendica.php
+++ b/src/Module/Friendica.php
@@ -120,10 +120,8 @@ class Friendica extends BaseModule
 			}
 		}
 
-		$app = DI::app();
-
 		// @TODO: Replace with parameter from router
-		if ($app->argc <= 1 || ($app->argv[1] !== 'json')) {
+		if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) {
 			return;
 		}
 
diff --git a/src/Module/Group.php b/src/Module/Group.php
index f9fdfd4477..063e41589f 100644
--- a/src/Module/Group.php
+++ b/src/Module/Group.php
@@ -47,7 +47,7 @@ class Group extends BaseModule
 		}
 
 		// @TODO: Replace with parameter from router
-		if (($a->argc == 2) && ($a->argv[1] === 'new')) {
+		if ((DI::args()->getArgc() == 2) && (DI::args()->getArgv()[1] === 'new')) {
 			BaseModule::checkFormSecurityTokenRedirectOnError('/group/new', 'group_edit');
 
 			$name = Strings::escapeTags(trim($_POST['groupname']));
@@ -64,10 +64,10 @@ class Group extends BaseModule
 		}
 
 		// @TODO: Replace with parameter from router
-		if (($a->argc == 2) && intval($a->argv[1])) {
+		if ((DI::args()->getArgc() == 2) && intval(DI::args()->getArgv()[1])) {
 			BaseModule::checkFormSecurityTokenRedirectOnError('/group', 'group_edit');
 
-			$group = DBA::selectFirst('group', ['id', 'name'], ['id' => $a->argv[1], 'uid' => local_user()]);
+			$group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => local_user()]);
 			if (!DBA::isResult($group)) {
 				notice(DI::l10n()->t('Group not found.'));
 				DI::baseUrl()->redirect('contact');
@@ -93,8 +93,8 @@ class Group extends BaseModule
 			// POST /group/123/add/123
 			// POST /group/123/remove/123
 			// @TODO: Replace with parameter from router
-			if ($a->argc == 4) {
-				list($group_id, $command, $contact_id) = array_slice($a->argv, 1);
+			if (DI::args()->getArgc() == 4) {
+				list($group_id, $command, $contact_id) = array_slice(DI::args()->getArgv(), 1);
 
 				if (!Model\Group::exists($group_id, local_user())) {
 					throw new \Exception(DI::l10n()->t('Unknown group.'), 404);
@@ -149,11 +149,11 @@ class Group extends BaseModule
 
 		$a = DI::app();
 
-		DI::page()['aside'] = Model\Group::sidebarWidget('contact', 'group', 'extended', (($a->argc > 1) ? $a->argv[1] : 'everyone'));
+		DI::page()['aside'] = Model\Group::sidebarWidget('contact', 'group', 'extended', ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : 'everyone'));
 
 		// With no group number provided we jump to the unassigned contacts as a starting point
 		// @TODO: Replace with parameter from router
-		if ($a->argc == 1) {
+		if (DI::args()->getArgc() == 1) {
 			DI::baseUrl()->redirect('group/none');
 		}
 
@@ -172,7 +172,7 @@ class Group extends BaseModule
 		];
 
 		// @TODO: Replace with parameter from router
-		if (($a->argc == 2) && ($a->argv[1] === 'new')) {
+		if ((DI::args()->getArgc() == 2) && (DI::args()->getArgv()[1] === 'new')) {
 			return Renderer::replaceMacros($tpl, $context + [
 				'$title' => DI::l10n()->t('Create a group of contacts/friends.'),
 				'$gname' => ['groupname', DI::l10n()->t('Group Name: '), '', ''],
@@ -184,8 +184,8 @@ class Group extends BaseModule
 		$nogroup = false;
 
 		// @TODO: Replace with parameter from router
-		if (($a->argc == 2) && ($a->argv[1] === 'none') ||
-			($a->argc == 1) && ($a->argv[0] === 'nogroup')) {
+		if ((DI::args()->getArgc() == 2) && (DI::args()->getArgv()[1] === 'none') ||
+			(DI::args()->getArgc() == 1) && (DI::args()->getArgv()[0] === 'nogroup')) {
 			$id = -1;
 			$nogroup = true;
 			$group = [
@@ -205,17 +205,17 @@ class Group extends BaseModule
 		}
 
 		// @TODO: Replace with parameter from router
-		if (($a->argc == 3) && ($a->argv[1] === 'drop')) {
+		if ((DI::args()->getArgc() == 3) && (DI::args()->getArgv()[1] === 'drop')) {
 			BaseModule::checkFormSecurityTokenRedirectOnError('/group', 'group_drop', 't');
 
 			// @TODO: Replace with parameter from router
-			if (intval($a->argv[2])) {
-				if (!Model\Group::exists($a->argv[2], local_user())) {
+			if (intval(DI::args()->getArgv()[2])) {
+				if (!Model\Group::exists(DI::args()->getArgv()[2], local_user())) {
 					notice(DI::l10n()->t('Group not found.'));
 					DI::baseUrl()->redirect('contact');
 				}
 
-				if (!Model\Group::remove($a->argv[2])) {
+				if (!Model\Group::remove(DI::args()->getArgv()[2])) {
 					notice(DI::l10n()->t('Unable to remove group.'));
 				}
 			}
@@ -223,17 +223,17 @@ class Group extends BaseModule
 		}
 
 		// @TODO: Replace with parameter from router
-		if (($a->argc > 2) && intval($a->argv[1]) && intval($a->argv[2])) {
+		if ((DI::args()->getArgc() > 2) && intval(DI::args()->getArgv()[1]) && intval(DI::args()->getArgv()[2])) {
 			BaseModule::checkFormSecurityTokenForbiddenOnError('group_member_change', 't');
 
-			if (DBA::exists('contact', ['id' => $a->argv[2], 'uid' => local_user(), 'self' => false, 'pending' => false, 'blocked' => false])) {
-				$change = intval($a->argv[2]);
+			if (DBA::exists('contact', ['id' => DI::args()->getArgv()[2], 'uid' => local_user(), 'self' => false, 'pending' => false, 'blocked' => false])) {
+				$change = intval(DI::args()->getArgv()[2]);
 			}
 		}
 
 		// @TODO: Replace with parameter from router
-		if (($a->argc > 1) && intval($a->argv[1])) {
-			$group = DBA::selectFirst('group', ['id', 'name'], ['id' => $a->argv[1], 'uid' => local_user(), 'deleted' => false]);
+		if ((DI::args()->getArgc() > 1) && intval(DI::args()->getArgv()[1])) {
+			$group = DBA::selectFirst('group', ['id', 'name'], ['id' => DI::args()->getArgv()[1], 'uid' => local_user(), 'deleted' => false]);
 			if (!DBA::isResult($group)) {
 				notice(DI::l10n()->t('Group not found.'));
 				DI::baseUrl()->redirect('contact');
diff --git a/src/Module/Help.php b/src/Module/Help.php
index 95aeb16459..a29e895579 100644
--- a/src/Module/Help.php
+++ b/src/Module/Help.php
@@ -45,11 +45,11 @@ class Help extends BaseModule
 		$lang = $config->get('system', 'language');
 
 		// @TODO: Replace with parameter from router
-		if ($a->argc > 1) {
+		if (DI::args()->getArgc() > 1) {
 			$path = '';
 			// looping through the argv keys bigger than 0 to build
 			// a path relative to /help
-			for ($x = 1; $x < $a->argc; $x ++) {
+			for ($x = 1; $x < DI::args()->getArgc(); $x ++) {
 				if (strlen($path)) {
 					$path .= '/';
 				}
diff --git a/src/Module/Oembed.php b/src/Module/Oembed.php
index a4586b9c1a..0d6fb8ee52 100644
--- a/src/Module/Oembed.php
+++ b/src/Module/Oembed.php
@@ -39,26 +39,24 @@ class Oembed extends BaseModule
 {
 	public static function content(array $parameters = [])
 	{
-		$a = DI::app();
-
 		// Unused form: /oembed/b2h?url=...
-		if ($a->argv[1] == 'b2h') {
+		if (DI::args()->getArgv()[1] == 'b2h') {
 			$url = ["", trim(hex2bin($_REQUEST['url']))];
 			echo Content\OEmbed::replaceCallback($url);
 			exit();
 		}
 
 		// Unused form: /oembed/h2b?text=...
-		if ($a->argv[1] == 'h2b') {
+		if (DI::args()->getArgv()[1] == 'h2b') {
 			$text = trim(hex2bin($_REQUEST['text']));
 			echo Content\OEmbed::HTML2BBCode($text);
 			exit();
 		}
 
 		// @TODO: Replace with parameter from router
-		if ($a->argc == 2) {
+		if (DI::args()->getArgc() == 2) {
 			echo '<html><body>';
-			$url = Strings::base64UrlDecode($a->argv[1]);
+			$url = Strings::base64UrlDecode(DI::args()->getArgv()[1]);
 			$j = Content\OEmbed::fetchURL($url);
 
 			// workaround for media.ccc.de (and any other endpoint that return size 0)
diff --git a/src/Module/PublicRSAKey.php b/src/Module/PublicRSAKey.php
index ad9bb6db84..a13130d1c9 100644
--- a/src/Module/PublicRSAKey.php
+++ b/src/Module/PublicRSAKey.php
@@ -27,7 +27,6 @@ use Friendica\Model\User;
 use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Util\Crypto;
 use Friendica\Util\Strings;
-use phpseclib\File\ASN1;
 
 /**
  * prints the public RSA key of a user
@@ -36,15 +35,11 @@ class PublicRSAKey extends BaseModule
 {
 	public static function rawContent(array $parameters = [])
 	{
-		$app = DI::app();
-
-		// @TODO: Replace with parameter from router
-		if ($app->argc !== 2) {
+		if (empty($parameters['nick'])) {
 			throw new BadRequestException();
 		}
 
-		// @TODO: Replace with parameter from router
-		$nick = $app->argv[1];
+		$nick = $parameters['nick'];
 
 		$user = User::getByNickname($nick, ['spubkey']);
 		if (empty($user) || empty($user['spubkey'])) {
diff --git a/src/Module/Smilies.php b/src/Module/Smilies.php
index f7f04aac9b..8ee641b5a6 100644
--- a/src/Module/Smilies.php
+++ b/src/Module/Smilies.php
@@ -23,6 +23,7 @@ namespace Friendica\Module;
 
 use Friendica\BaseModule;
 use Friendica\Content;
+use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\DI;
@@ -34,9 +35,7 @@ class Smilies extends BaseModule
 {
 	public static function rawContent(array $parameters = [])
 	{
-		$app = DI::app();
-
-		if (!empty($app->argv[1]) && ($app->argv[1] === "json")) {
+		if (!empty(DI::args()->getArgv()[1]) && (DI::args()->getArgv()[1] === "json")) {
 			$smilies = Content\Smilies::getList();
 			$results = [];
 			for ($i = 0; $i < count($smilies['texts']); $i++) {
diff --git a/src/Module/Xrd.php b/src/Module/Xrd.php
index d63fcb5eeb..7e380946ff 100644
--- a/src/Module/Xrd.php
+++ b/src/Module/Xrd.php
@@ -40,10 +40,8 @@ class Xrd extends BaseModule
 {
 	public static function rawContent(array $parameters = [])
 	{
-		$app = DI::app();
-
 		// @TODO: Replace with parameter from router
-		if ($app->argv[0] == 'xrd') {
+		if (DI::args()->getArgv()[0] == 'xrd') {
 			if (empty($_GET['uri'])) {
 				return;
 			}
diff --git a/src/Security/Authentication.php b/src/Security/Authentication.php
index d93f7f9dc5..ebeadcc37b 100644
--- a/src/Security/Authentication.php
+++ b/src/Security/Authentication.php
@@ -343,7 +343,7 @@ class Authentication
 			}
 		}
 
-		$this->redirectForTwoFactorAuthentication($user_record['uid'], $a);
+		$this->redirectForTwoFactorAuthentication($user_record['uid']);
 
 		if ($interactive) {
 			if ($user_record['login_date'] <= DBA::NULL_DATETIME) {
@@ -369,12 +369,11 @@ class Authentication
 	 * All return calls in this method skip two-factor authentication
 	 *
 	 * @param int $uid The User Identified
-	 * @param App $a   The Friendica Application context
 	 *
 	 * @throws HTTPException\ForbiddenException In case the two factor authentication is forbidden (e.g. for AJAX calls)
 	 * @throws HTTPException\InternalServerErrorException
 	 */
-	private function redirectForTwoFactorAuthentication(int $uid, App $a)
+	private function redirectForTwoFactorAuthentication(int $uid)
 	{
 		// Check user setting, if 2FA disabled return
 		if (!$this->pConfig->get($uid, '2fa', 'verified')) {
@@ -382,7 +381,7 @@ class Authentication
 		}
 
 		// Check current path, if public or 2fa module return
-		if ($a->argc > 0 && in_array($a->argv[0], ['2fa', 'view', 'help', 'api', 'proxy', 'logout'])) {
+		if (DI::args()->getArgc() > 0 && in_array(DI::args()->getArgv()[0], ['2fa', 'view', 'help', 'api', 'proxy', 'logout'])) {
 			return;
 		}