refactored elasticsearch COnnection and Command