Move data-gathering code into its own method, so that it can be easily skipped if the file is already known.