Move those cookie functions out on their own for cleaning up later / use elsewhere