restructuring
localstorage support