Rich&Sam: Various refactorings to support summary page generation.