updating this to match es_caselis corehq refactorings