sorting saving into cookies, title refactoring