Improve project pick modal and setCookie code