slightly less brittle parsing