Added caching and documentation