Refactor archive_file