move localstorage to model