Removed redundant code. Added a cache basic interface.