Some private functions are useful elsewhere.