before cookie refactor