Removing senseless passings by reference