added dict and cache.  factored out from pug