tree schema
Clean up and demo implementation