This seems brittle.  Is there a better way?