Added some functions to aide caching..