fix sonar issues, removed unused code