Replacing some pass by value with pass by reference.