Revert "NPE checks"

This reverts commit c328f2bad22075d46a5dcaae9878d250a8839f5a.
Revert "various fixes for sonar issues"

This reverts commit 1d0947bd88e9deb8ab17fc9b357b1b502902b686.