Added CacheReference
Many fixes/improvements