Move static private helper `subDirectoriesCount` into anonymous namespace
There is no reason to have this as a class method, so remove it from the class declaration.
There is no reason to have this as a class method, so remove it from the class declaration.