refactorin: _do_log