small refactor to logging