Split parts of build_fastqs into a seperate function.