before refactoring for keyword search