Why does this need to be an independent function?