Changing implementation to new localStorage library