removed several redundant null-checks