Refactoring of logging listener.
Removed complexity.