refactor CookiesHelper