Refs #3405 Refactoring archive.php so I can understand it well