refactoring logger module