useful general classes and functions