DRY up pages controller.