logging fix
small refactor