refactor Cookies