Replacing assignment with method call only when the variable being replaced is on the left hand side
Eliminating duplication in replace_vars method