Fix a bug on cache.
Separate searching engines to independent functions.