logging messages refactor