fixed some sonar violations