refactor code + cart class/cookie storage