Added a simple cache-helper function.