Move the file count check inside the conditional, speeds up processing by doing less regex matches.