DRYing out views code