Extracted the logging into an observer