I feel like there should be a way to combine these two if statement branches, but I can't figure it out.  Quoting is tricky!