refactor installed_apps, more reorg for global