refactoring
serialization to localStorage added