Refactor - elasticsearch/java agnostic