clean up theme/cookie code