Better implemantation for remote and local storage

Better implemantation for remote and local storage