DISCL-235: Code review Friday refactorings

This is preliminary draft review
seriously :) pow function for 2 to the power x