refactoring: some nullness cleanups