Refactoring unit cookie