Simplify search handling in kitin.py