refactor delete for localstorage page load