refactors list_apps