Refactoring of cookie repository