Remove unnecessary pass-by-reference in function definitions