fix some Sonar major issues