I'd do the term filtering here:
```javascript
if (terms.length > 1) {
  terms = terms.filter(function(term) { return term.length > 2; });
}
}