You could do only one call to indexOf with ESCAPED_FRAGMENT_FORMAT1 and then 
```
if (queryString,charAt(index - 1) == '&') {
   index --;
}
```