Shared utility functions used in Rymd