Use non-const references instead of non-const pointers.