End recursion at null node

And some restructure...
FML