fixed most sonar issues