code cleanups from sonar static analysis
more static analysis cleanup