big refactoring in the history
refactor
refactor and add elasticsearch lib