It's a better practice to reduce nesting where possible; here we could do:
if rootNod == null => return
....

this way we have removed a nesting level
Applies to other places as well below.