refactor + apps_total