Refactored the archive method