some logging refactoring