Better use of call-by-reference