Extract localStorage into storage service.