added cached method
refactored cache