Replacing pointers with references where not needed.