Remove duplicate code in transcripts_ajax.