http://goessner.net/articles/JsonPath/ (Might also consider XPath & XML responses...) Upshot would be much more decoupled event handlers and responses - an easy to maintain a "retain enclosure" rule would handle it.