identify digit-only subdirectories via regexp instead of shell globbing & extract into common method