Added CachedObject interface and cleaned up some other code