clean up unused and unneeded code
refactored cookie check into service