refactoring local storage service