Continuing refactoring - implemented boolean query backtracking