Add recursive method to remove empty nodes and update code. Add 'private' protection to internal methods.