Made LocalStorage into a Factory