Added some caching to improve start up times.