buildElasticRaw changed from side effects to obj copy