If you made this a class method rather than a static one, you wouldn't have to keep saying "ElasticSearchBase.whatever" all the time below. You could keep it to simply "cls.whatever", and it wouldn't need to be changed if you ever renamed the class. Also, shorter. :-)