refactor, add localStorage class