Refactory Elastic module