REFACTOR es customer query module