Refactoring to add in a separate search class
Refactoring to support two different kinds of BUC query.