Fixed sonar issues
Fixed some sonar issues
Minor code reformatting