Some Sonar optimizations