elasticsearch and core refactorings