refactoring logger