continue refactoring for localStorage