Saving on local storage, improving in code design