Refactored logger