week 4 updates
refactoring to cache data