common impl of localstorage in appctrl