Add utility functions and classes