Moving internal cookie functions to Internal