Collection of useful functions.