Optimize replaceFleaVars