persistent binary trees with records and universal design patter