This is a nice simplification!  (Using a more generic string and eliminating the "opposite type" stuff here).