Improve ElasticSearchWriterFactory implementation