yes, sub is very performant (http://yuilibrary.com/yui/docs/api/files/yui_js_yui-lang.js.html#l251), it is not going to take more than the `indexOf('{')` operation that you have anyways. lets change it.