refactor to add a checked_archive function