More replacing poor use of variables