Change code formatting to fix some sonar major violations