Place these functions at the module level.