Tree validation uses udfs

Good impulse.