Reduce use of naked pointers
Cleanups:
* Prefer references over pointers
* Use auto when it makes sense