store seed in localstorage, refactoring, fix bugs