Extracting elastic.io part into own method and wrapper.