removing all pass-by-reference