major refactor, bug fixing, re-integrating and validating elastic search