cookie refactor WIP