Add tree data cleaning code.