Use yield instead of building the list of files in memory