add a cache iterator, and group functions into modules