DISCL-235: Code review Friday refactorings

This is preliminary draft review
Dont use .get() on shared_ptr unless the API forces you to do that