An assorted collection of helper functions