Applying my improvement to the logger