Extract this to a helper; since you're using it in many places. DRY, baby, DRY!