         var subcategories: [PiwigoAlbumData] = []
 
         // Look for known requested sub-categories
-        for category in allCategories {
-
-            // Only add sub-categories of tapped category
-            if ((category.parentAlbumId != categoryTapped.albumId) ||
-                (category.albumId == currentCategory)) {
-                continue
-            }
-            subcategories.append(category)
-        }
+        subcategories.append(contentsOf: allCategories.filter({ $0.parentAlbumId == categoryTapped.albumId })
+                                                      .filter({ $0.albumId != currentCategory }))
 
         // Look for sub-categories which are already displayed
         var nberDisplayedSubCategories = 0
-        for category in subcategories {
-
-            for existingCat in categories {
-
-                if category.albumId == existingCat.albumId {
-                    nberDisplayedSubCategories += 1
-                    break
-                }
-            }
+        subcategories.forEach { category in
+            nberDisplayedSubCategories += categories.filter({ $0.albumId == category.albumId}).count
         }
 
         // This test depends on the caching option loadAllCategoryInfo:

        var diff: [PiwigoAlbumData] = []

        // Look for sub-categories to remove
        for category in categories {

            // Keep the parent category
            if category.albumId == categoryTapped.albumId {
                continue
            }

            // Remove the sub-categories
            let upperCategories = category.upperCategories
            if upperCategories?.contains(String(format: "%ld", Int(categoryTapped.albumId))) ?? false {

        present(alert, animated: true, completion: {
            // Bugfix: iOS9 - Tint not fully Applied without Reapplying
            alert.view.tintColor = UIColor.piwigoColorOrange()
        })
    }

    
