mv miniQuery to lib and modify index