Code Quality: fixed several Sonar issues (no functionality change)
Code Quality: removed some unused memory management functions (no functionality change)