Refactored Sonar.java by removing unnecessary code.