More sophisticated before filter for program routes