remove redundant tests and add search and replace attributes defined as KPIs in formula