more using references instead of pointers where it makes sense
more references from pointers
more of the same
more by reference instead of pointer
refactor for RAII
explode rather than have undefined behavior