Caching Weather to localstorage. Refactored code