add model based logic for local storage