Basic and generic utility functions and definitions.