refactored logger