Wrap search code around a class to avoid using globals