data caching and function decoupling