Fixed some sonar warning
Formatted the code to fit our coding rules