Optimized caching + fixed note bug