refactoring and trying out elastic4s