diff --git a/bwa.wdl b/bwa.wdl
index 01d1b7d08b798083d0bb7dbf6fd74ce4ebe64a14..ba0023a3194c58e85b534d06371d6ab5a5e51184 100644
--- a/bwa.wdl
+++ b/bwa.wdl
@@ -5,8 +5,7 @@ task Mem {
         String? preCommand
         File inputR1
         File? inputR2
-        File referenceFasta
-        Array[File] indexFiles # These indexFiles need to be added, otherwise cromwell will not find them.
+        BwaIndex bwaIndex
         String outputPath
         String? readgroup
 
@@ -20,7 +19,7 @@ task Mem {
         ~{preCommand}
         bwa mem ~{"-t " + threads} \
         ~{"-R '" + readgroup + "'"} \
-        ~{referenceFasta} \
+        ~{bwaIndex.fastaFile} \
         ~{inputR1} \
         ~{inputR2} \
         | samtools sort --output-fmt BAM - > ~{outputPath}
@@ -75,3 +74,7 @@ task Index {
     }
 }
 
+struct BwaIndex {
+    File fastaFile
+    Array[File] indexFiles
+}
diff --git a/common.wdl b/common.wdl
index 15e99f5804089fdd328f263b21804dc18712e752..379da32aa5d4b795960918ce488811e4a16013ce 100644
--- a/common.wdl
+++ b/common.wdl
@@ -134,3 +134,9 @@ task StringArrayMd5 {
         memory: 1
     }
 }
+
+struct Reference {
+    File fasta
+    File fai
+    File dict
+}