reduce code dup in apps.bowtie and apps.bwa