create and cache a reusable function
Merge pull request #8 from component/cache

create and cache a reusable function