search a valid config file optimzed