refactored logger a bit