DISCL-235: Code review Friday refactorings

This is preliminary draft review
Fixed. Although honestly we never even compiled this part of the code ;-)