refined local storage functions