split cookie and storage, update template loader