DRY up rendering of different page types