refactoring of the logger