This is a great place for this cast! @arvoelke and I were talking about putting it somewhere in the Connection class before, but this makes so much more sense.