Added logging to Shtorka and some small refactoring