Localstorage is used + refactoring