fixed sonar violations