cleaned up caching code - deprecated several functions