Sonar cleanup and logging