Utility functions and classes for various things