refactor in order to reduce the dependency on elastic search at client side, reduce deployment size