INTERNAL miscellaneous utility functions.