more caching fixes and optimizations...