Fixed formatting for anonymous functions
Improved caching flexibility and security