cookieuser refactor