improve cached decorator - add simple in-function caching