log messages refactoring