Making the recently viewed data flowing via cookie
Abstracting the logic to extract entity name from url