Optimize number of search replace in files