The getCookie function was being implemented a couple of times across the pages. These changes create a single implementation and imports the helper function whenever needed.