Refactor ScanDirectory method signature.