WIP - factor out get_file_tag.