slightly clean up cookie store code