added caching and style improvements