refactored cache, removed unused imports