template refactoring for more flexibility in archive pages