Improve archiveData() to be more generic