major Sonar findings fixed for Main class