Fix NPEs.
Sonar throws Exception s.
tidy static helpers.
make constructor called overridable methods final