Mini-refactor finished: +references, -pointers

Still not 100% sure that this is the right way, but in theory this is
more idiomatic.