This function should probably go in namespace detail