I don't particularly like the name of this function.